- List, Tuple, Dictionary, Set Lists are mutable(changable) a =[] a.append(stuff)
tuples are same as lists except it is not mutable c = (1,2,3)
dictionary : key-value pairs d = {} d['1'] = 2
Sets are a collection of unordered elements that are unique u can perform union, intersection etc on sets e = {2,3,4,5}
- stack, Queue, Tree, LinkedList, Graph, Hashmaps
stack : Linear data structure (last in first out) push,pop,access from the top used in recursive programming, reversing words, undo mechanisms in word editors and so forth
queues : linear data structure (first in first out) operations can be performed from both ends of the queue(head-tail/front-back) the operation of adding and deleting element is called nqueue and dequeue used as network buffers for traffic conjestion management, job scheduling etc.
trees : non-linear data structures with roots and nodes. last nodes -> leaves. used in html pages, search operations etc.
linked list : linear data structures (image viewing application)
graphs : data collection of points containing vertices and edges used to find cost effective paths between nodes(google maps, uber uses graphs)
hashmaps: same as dictionaries in python
- Divide and conquer
- Dynamic programming
- Greedy algorithms
- Pre-order
- Post-order
- In-order : Visit the left node->root->right node
- Merge sort : Follows the divide and conquer rule. The given list is first divided into smaller lists and compares adjacent lists and then reorders them in the desired sequence.
Data lookup by key
In-place Array operations help to reduce space complexity