data structures fall 2013. what is a data structure? a data structure is a method of organizing...
TRANSCRIPT
![Page 1: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/1.jpg)
Data Structures
Fall
2013
![Page 2: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/2.jpg)
What is a Data Structure?
• A data structure is a method of organizing data.
• The study of data structures is particularly important when using an object-oriented programming language.
![Page 3: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/3.jpg)
Simple Data Types
• Many programming languages provide built-in simple data types. For example:– Characters– Integers– Real Numbers– Boolean (TRUE, FALSE)– Strings (words)
![Page 4: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/4.jpg)
Arrays
• A one-dimensional array can be thought of as a list or a vector. It is a homogeneous collection of data.
• For example, an array of 10 integers might take 20 bytes of storage. If the name of the array is IntArray, the 10 integers might be accessed as IntArray[0], IntArray[1], ... , IntArray[9].
![Page 5: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/5.jpg)
Arrays II
• Most programming languages provide built-in arrays.
• Most programming languages provide for multi-dimensional arrays.
• A two-dimensional array, for example, allows the programmer to think of the data as being organized in a table (rows and columns). Note this is a virtual table.
![Page 6: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/6.jpg)
Records
• A record is a heterogeneous data structure.
• For example, a student record, or a customer record.
• The individual components of a record are called fields.
![Page 7: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/7.jpg)
Abstract Data Type
• An ADT is a data structure together with the operations that are allowed on the data structure.
• STACK: FILO structure, top, Push, Pop
• QUEUE: FIFO structure, head, tail (front, back), Enqueue, Dequeue
• LIST: head, tail, current, Insert, Delete, Next
![Page 8: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/8.jpg)
Pointers• A pointer is a structure that contains not
data but an address that points to data.
• The Program Counter can be considered as a pointer.
• Pointers allow for dynamic memory allocation.
• Many data structures can be implemented either with dynamic or static memory allocation.
![Page 9: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/9.jpg)
Other Structures
• Trees: Family tree, Directory, Binary Tree, Game Tree
• Graphs: A general graph is a mathematical structure that consists of a set of vertices and a set of edges. The study of graph theory is very important in theoretical Computer Science.
![Page 10: Data Structures Fall 2013. What is a Data Structure? A data structure is a method of organizing data. The study of data structures is particularly important](https://reader036.vdocuments.net/reader036/viewer/2022081000/56649f295503460f94c41c72/html5/thumbnails/10.jpg)
To study for the Quiz
What is an Abstract Data Type?
Be able to describe the following ADT’s by their actions and how they can be implemented:
Stack, Queue, Binary Tree, Graph
Distinction between dynamic and static.