Root
Parent, Child, Silbing
terms Node - key (name) that can have payload
Edge
Path
Height
post-order
BST: log n Traversal Depth first search
get Tree pre-order
list: 1
dict: 1 in-order
search
BST: log n
operations on Data object
list: (n + k)
insert Binary Tree
dict: 1 Array
set
Binary Search Tree (BST)
Singly linked list/ Doubly linked list
del types Balanced Binary Tree (AVL)
Hash table
list: nlogn Binary Heap
sort Stack
Queue
Data structures Deque
Sorted list
Implemented by Binary Search Tree
Map ADT Balanced Binary Tree (AVL)
Hash table
Tree
Grap
Data structures & Algorithm
List (like Singly Linked List in Python)
Node - Vertex with key (name) that can have payload (value)
terms
Edge (directed or undirected) - Arc
all built-in primitive data types are in fact ADT
what user knows, like interface/ API/ ABC
Weight
exp: stack -> pop(), push(), peek()
List, Stack, Queue, Map, Priority Queue, Deque, Tree, Graph
Time
Asymptotic notation
Analysis
Dictionary (like Map ADT in Python) adjacency matrix
Abstract data types (ADT) Graph
ADT vs Data Structures Map ADT
Python has ABC modules based on OOP, as interface
implemented by
implementing Domain Object as ADT = Django Model key terms Algorithm adjacency list
Encapsulation is good, it enforces the business logic for create, update
Domain Object Graph ADT
Space
linear type
Binary
no-linear
Linear
data structures are actually an implementation of Abstract Data Types or ADT.
This implementation requires a physical view of data using some collection of Search
programming constructs and basic data type Hash table
Bubble
exp: Map ADT implemented as
Binary Search Tree (BST) Selection
Balanced Binary Tree (AVL) Data structures
Sorted list
Hash table Insertion adjacency map
Sort Shell
Array, Singly Linked List, Double Linked List, Binary Tree, AVL, Hash Table, Tree, Graph
Data type/ Data model/ Data object Merge
built-in primitive data type: int, list, dict, string Quick
built-in container data type: dict, list, set, tuple
Brute force
Iterative
call itself, recursively
3 laws
Style must have a base case
Recursive
must change state to base case
Divide and conquer