Consider the student records for UBC students which contain
Solution
Q5)
ans: Queue,AVL Tree
Explanation:Queue is an abstract data structure, somewhat similar to Stacks.Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first.
A real-world example of queue can be a single-lane one-way road, where the vehicle enters first, exits first.
Step 1 Check if the queue is full.
Step 2 If the queue is full, produce overflow error and exit.
Step 3 If the queue is not full, increment rear pointer to point the next empty space.
Step 4 Add data element to the queue location, where the rear is pointing.
Step 5 return success.
AVL tree may perform the following four kinds of rotations.
Q6)
ans: Stack,heap
explanation:A stack is an Abstract Data Type (ADT), commonly used in most programming languages.
This feature makes it LIFO data structure. LIFO stands for Last-in-first-out. Here, the element which is placed (inserted or added) last, is accessed first. In stack terminology, insertion operation is called PUSH operation and removal operation is called POP operation.
Heap is a special case of balanced binary tree data structure where the root-node key is compared with its children and arranged accordingly. If has child node then
key() key()
push() Pushing (storing) an element on the stack.
pop() Removing (accessing) an element from the stack.
