Consider the student records for UBC students which contain

Consider the student records for UBC students, which contain courses, grades (including GPA), year of study, and major. Students can be added (new registration or transfer) and deleted (graduated, dropped out, or transferred). Select all the data structured) that give the lowest asymptotic complexity (worst-case, expected, or amortized) to return the student with the highest ranking GPA? (Do not worry about insertion time.) Unsorted list Queue Stack Hash table Heap Red-Black tree Skip list Unsorted array AVL tree Consider the student records for UBC students, which contain courses, grades (including GPA), year of study, and major. Students can be added (new registration or transfer) and deleted (graduated, dropped out, or transferred). Select all the data structure^) that give the lowest asymptotic complexity (worst-case, expected, or amortized) to return all the students with GPA between 75% and 85%? (Do not worry about insertion time.) AVL tree each Stack each Skip list Red-Black tree Queue Hash table Heap Unsorted array Unsorted list

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.

 Consider the student records for UBC students, which contain courses, grades (including GPA), year of study, and major. Students can be added (new registration

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site