Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

char *strings [6] cheetah, jaguar, tiger, leopard, lion, puma) Write out the array after it has been converted into a max heap (that is, every

image text in transcribed

char *strings [6] "cheetah", "jaguar", "tiger", "leopard", "lion", "puma") Write out the array after it has been converted into a max heap (that is, every parent node is greater than any of its child nodes) using the build_heap algorithm described in the subject. The strings in the array are compared alphabetically. 1.5 4 marks You are given an int array A of size 5 as a hash table, where empty buckets have a value of -1. An int typed key is inserted into the hash table using a hash fune- tion h (key) key * (key + 3) % 5, and collisions are handled by separate chaining with linked lists Write out the hash table after each of the following key values has been inserted into the hash table: 1, 3, 5, 7 (you need to write out a total of 4 hash tables). 1.6 [1 mark] Consider a hash table where the underlying array has a size of n, and the computation of the hash function has a time complexity of 0(1). If separate chaining with linked lists is used to handle collisions, after m key values have been inserted into the hash table, what is the worst-case time complexity in big-O notation (in terms of the number of key comparisons) of searching for a key value from this hash table

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

5. Develop a self-management module for a training program.

Answered: 1 week ago