Unit 4-1 Marks
Unit 4-1 Marks
9. Define B-Tree.
A B-Tree is a self-balancing search tree where nodes can have multiple children,
maintaining sorted order and efficient search, insert, and delete operations.
12. Define priority queue (heap). What is the need for priority queue?
A priority queue is a special type of queue where each element is associated with a
priority, and elements are dequeued based on their priority rather than their order of
arrival.
Need for Priority Queue:
• Task scheduling (e.g., CPU scheduling).
• Handling jobs or events based on urgency (e.g., hospital emergency rooms).
A heap is a binary tree-based data structure used to implement a priority queue. It
satisfies the heap property
30. Write the advantages of AVL trees compared to binary search trees.
• AVL trees are always balanced, ensuring O(logn)O(\log n)O(logn) time for search,
insertion, and deletion.
• Prevents skewed trees, which degrade performance in binary search trees.