Important Topics Data Structure Notes
Important Topics Data Structure Notes
Important Topics Data Structure Notes
- Linear vs Non-Linear Data Structures: Linear data structures (arrays, linked lists, stacks, queues) have
elements arranged in a sequential manner, whereas non-linear data structures (trees, graphs) have
- Linear Search vs Binary Search: Linear search checks each element one by one, while binary search
halves the data set in each step but requires sorted data.
- Postfix Expression Evaluation using Stacks: Convert infix expressions to postfix, then evaluate using a
- Circular Queue: A queue that wraps around once it reaches the end, solving the issue of wasted space in
linear queues.
- Stack Algorithms: Well-formedness check for parentheses ensures that each opening bracket has a
3. Graph Algorithms
- BFS (Breadth-First Search): Explores nodes level by level, using a queue to track the next node to visit.
- DFS (Depth-First Search): Explores as far as possible along each branch before backtracking, using a stack
(or recursion).
- Topological Sorting: An ordering of vertices in a Directed Acyclic Graph (DAG) such that for every directed
4. Tree Structures
- Binary Search Tree (BST): A binary tree in which the left child contains only nodes with values less than the
parent node, and the right child only nodes with values greater than the parent.
- AVL Tree: A self-balancing BST where the difference in heights of left and right subtrees of any node is less
than or equal to 1.
- B-trees: Generalized binary trees used for storing data, often used in databases.
5. Huffman Coding
- Huffman Tree: A tree used to compress data by assigning shorter codes to more frequent characters and
- The process involves building a tree where each leaf node represents a character, and the path to the node
6. Hashing Techniques
- Hashing: A process that maps data to a fixed-size value (hash). Used for efficient look-up and retrieval.
- Collision Handling: Methods like linear probing handle hash collisions by finding the next available slot in the
array.
- Doubly Linked List: Each node contains pointers to both the next and previous nodes. Operations include
- Circular Linked List: The last node points back to the first node, forming a circle. Efficient for situations