Abstract Data Types
Data Structure | Data Attributes | Operations | Possible Implementations |
---|---|---|---|
Array | get_value_at_index(A, i) set_value_at_index(A,i,v) |
||
Linked List | Node(data, next) List(head) |
insert() insert_sorted() find(value) remove(item) reverse() compare() merge() is_palindrome detect_loop |
|
Doubly Linked List | Node(data, prev, next) List(head) |
Same as Linked List |
Binary Tree | Node(data, left, right) Tree(root) |
insert(val) find(value) find_parent(value) find_successor(value) remove(target) size() (recursive, iterative) depth() (recursive, iterative) check_if_balanced() find_path(target) lowest_common_ancestor(x,y) (recursive, iterative) inorder_traversal(&visit) postorder_traversal(&visit) preorder_traversal(&visit) level_order_traversal(root, &visit) (uses a queue) reconstruct(inorder, preorder) |
Queue | Queue(head, tail) | push(data) pop(data) empty?() |
List Array Stack |
Stack | Stack(list) | push(data) pop() peek() empty?() |
List Array Queue |
Heap | Heap(array, compare) | [](index) []=(index, value) size() insert() find_first() or find_max() remove_first() or remove_max() find_top_k() |
|
Hash Table | HashTable(hash_fn, entries) | insert(key,value) resize!(size) most_common_element(stream) MRU_cache() |
Separate Chaining Open Addressing Cuckoo Hashing |
Graph | Graph(value, neighbors) | bfs(origin, &visit) dfs(origin, &visit) find_distances(origin) find_ancestry(data,id) topological_sort(origin) has_cycle?(origin) |
-
Categories
-
Database
-
Programming
-
Workflow
-
Devops
-
Architecture
-
Ui
-
Frameworks
-
Blogging