Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
15 Cards in this Set
- Front
- Back
Array |
- Fixed-sized - indexed - contiguous structures whose elements are all of the same type, and whose elements can be accessed in constant time given their indices. |
|
Vectors |
- Also known as "growable arrays" or ArrayLists. - they're objects that are backed by a fixed-size array, and that they resize themselves as necessary. |
|
Linked List |
Lists made of nodes that contain a data item and a pointer/reference to the next (and possibly previous) node. |
|
Hashtable |
- Amortized constant-time to access data - map keys to values, and are backed by a real array in memory, with some form of collision handling for values that hash to the same location. Example: - used for fast data lookup - symbol table for compilers, database indexing, caches,Unique data representation. |
|
Trees |
Data structures that consist of nodes with optional data elements and one or more child pointers/references, and possibly parent pointers, representing a heirarchical or ordered set of data elements. |
|
Graphs |
Represent arbitrary relationships between members of any data set, represented as networks of nodes and edges. Examples: - Connections/relations in social networking sites, Routing ,networks of communication, data organization etc. |
|
Heap |
- Specialized tree-based data structure that satisfies the heap property: If A is a parent node of B then the key (the value) of node A is ordered with respect to the key of node B with the same ordering applying across the heap. Example: - Dynamic memory allocation in lisp - Order statistics: The Heap data structure can be used to efficiently find the kth smallest (or largest) element in an array. - Sorting Algorithm |
|
Application areas of Stacks |
- compilers, operating systems, handling of program memory (nested function calls) |
|
Stacks |
- First In Last Out (FILO). - Insertions and removals from "top" position only |
|
Queue |
- First In First Out (FIFO). - Insertions at the "end" of the queue, and removals from the "front" of the queue. - two primary operations: enqueue and dequeue |
|
Application areas ofQueue |
Include print job scheduling, operating systems (process scheduling). |
|
Abstract Data Type |
- An abstract data type is a specification (or interface) for how to interact with a sort of data structure which doesn’t make any statements about how the data structure works.
|
|
Examples of Abstract Data Type |
- List can be described in terms of an abstract data type (we can insert into it, get the nth element, delete an element, etc.), while a linked list is an implementation of that abstract data type (it implements the specified behavior by structuring the data as either an empty list or a pairing of a data element and another linked list). - an abstract stack can be implemented by a linked list or by an array (which are concrete data types). - Examples : Priority queue : a shorthand way of describing a particular interface and behavior, and says nothing about the underlying implementation. ( a heap would be a data structure) |
|
What describe an abstract data structure? |
- Give the relationship between the objects being stored, and - Specify the operations which are to be optimized with respect to time and/or space. |
|
Priority_queue |
Its a specialized complete binary tree where the keys must satisfy the heap property - the key at each node is at least as great as the keys storedat its children. 2i + 1 and 2i + 2. - Use a heap when you care about the K largest and smallest elements - - Compute the k largest (use a min-heap) and the k smallest (use a max-heap) - Insertion : O(logn) - - Lookup for the max(or min) element: O(1) - Delete the max(or min) element : O(logn) - Searching for arbitraty keys : O(n) |