1. Below are four computational tasks. For each one, choose the data structure o
ID: 3588622 • Letter: 1
Question
1. Below are four computational tasks. For each one, choose the data structure or abstract data type you feel best suited to the task from the following list: Stack, Queue, Hashtable, AVL Tree, Priority Queue, Union-Find. In addition, list the basic operations for the data structure or ADT that you chose and give asymptotic worst-case running times for those operations. No additional explanation is required.
a) While processing a list of objects, check if you have processed a particular object before.
b) Store a list of students and their grades. You must also provide an efficient way for a client to see all students sorted in alphabetical order by name. Give the running time for this operation as well.
c) Process a digital image to divide the image up into groups of pixels of the same color.
d) Compute a frequency analysis on a _le. That is, count the number of times each character occurs in the file, and store the results
Explanation / Answer
a) priority queue :- It is also same like queue structure but it has priority. It process the elements which is having more priority in that current node.
b) Avl tree :- It is a self balancing binary search tree. It balances nodes in every position.
C) union find it is a disjoint set of data structure which stores data partitioned in a disjointed sets.
D) Hash table it uses a function to compute the index into an array of bucket to find the value.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.