DSA_Lab_Oral_Guide
DSA_Lab_Oral_Guide
- Hashing: Process of mapping a large dataset to a smaller fixed-size dataset using a hash function
- Good Hash Function: Should be fast, uniform, minimize collisions, and be deterministic.
- Collision Handling:
- Overflow: Happens when no empty slot is available even after collision resolution.
- Comparison of strategies: Chaining handles overflow better; linear probing can cause clustering.
- Union, Intersection, Difference, Subset: Perform standard set operations using mathematical
rules.
Assignment 3: Trees
- Tree: A hierarchical data structure where each node has 0 or more child nodes.
- Terminologies:
- Types of Trees: Binary, Binary Search Tree, AVL Tree, Threaded Tree, B-Tree, etc.
- BST Dictionary: Stores keywords (key) and their meanings (value) with ordered structure.
- Max Comparisons: At most equal to height of the tree (O(log n) for balanced tree).
- Advantages:
- Faster traversal.
- Saves space.
- Adjacency List: Linked list per vertex, efficient for sparse graphs.
- Complexity:
- Matrix: O(V^2)
- List: O(V+E)
- Minimum Spanning Tree: Spanning tree with minimum edge weight sum.
- Algorithms:
- When to use:
- OBST: BST built considering access probabilities to minimize expected search cost.
- Rotations:
- Single Rotation: LL, RR.
- Operations:
- Advantages:
- Simple structure.
- Disadvantages:
Common Questions
- Use Cases:
- Tree vs Graph:
- Tree: No cycles.