1. An operating system execute process depending on their priority. Where highest number has highest priority. Consider
Posted: Fri May 20, 2022 12:25 pm
1. An operating system execute process depending on their priority. Where highest number has highest priority. Consider at a particular instance of time, 10 processes arrives with following priority. Now build a Binary Heap using the priority number. Process Priority Process Priority P1 3 P6 3 P2 5 P7 4 P3 2 P8 5 P4 4 P9 1 PS P10 6 6 b. Now delete the top four priority patients from the heap and perform necessary operations to rebuild the heap after deletion. 2. Show breadth-first traversal of the following graph, where A is the starting node. Visit adjacent nodes in an anticlockwise ordering from a particular node (12 o'clock position) 3. Create a hash table of size 11 by inserting the items 74, 924, 83, 113 and 5. To insert the item k, use the hash function k % TableSize and resolve collisions with quadratic probing. We now consider looking up for the items 65 and 76 that are not in the table after doing the insertions above. For each, give the list of buckets that are looked at in order before determining that the item is not present. Include all the buckets examined, whether or not they contain an item. 4. Given an array of integers [12. 3. 40, 1, 21, 4, and 1). Now write a program that will sort the elements in ascending order using Binary Heap. 5. Write a program to find the out-degree of a single vertex whose graph is stored in an adjacency list. Example: Input Output Number of Vertices, n=4 Vertex 2 has out degree: 2 0 1 + 2 6 If we have some elements like {15, 47, 23, 34, 85, 97, 65, 89, 70). And our hash function is h(x) = x mod 7. If any collision happens then solve it with chaining.