Question

In: Computer Science

a) Given an array A [ 20, 60 , 80 , 90 , 90 , 100 , 110 ] and key = 90 ; in how many iterations would the liner search and binary search reach to the key ? And why?

Q : Give a brief answer to the following questions: :

a) Given an array A [ 20, 60 , 80 , 90 , 90 , 100 , 110 ] and key = 90 ; in how many iterations would the liner search and binary search reach to the key ? And why ? (2 marks )

b) What is the name of the algorithm that is able to find the kth smallest element in an unordered list (1 mark) ?

c) If several elements are competing for the same bucket in the hash table, what is it called? and list two techniques to avoid this scenario?

d) In simple uniform hashing, what is the search complexity ? (1 mark)

e) Let A be an array with N integer numbers, where all N numbers has a value between 1 and 3N. How fast can the N numbers be sorted? O(1), O(3N), O(N log N), or O(N2). What’s the sorting algorithm that should be used to achieve your choice?

f) Arrange the complexities of the following operations (from worst to best):   2 n2, 2 log n , n log 3n , 4 n , 55 log 64 , 2n . (3 marks )

g) mention one advantage of the heap-sort over the merge-sort algorithm and list their complexities (3 marks )

Solutions

Expert Solution


Related Solutions

Males Females Total Like Sociology 30 80 110 Not Like Sociology 70 20 90 Total 100...
Males Females Total Like Sociology 30 80 110 Not Like Sociology 70 20 90 Total 100 100 200 Using this table, write assumptions, hypotheses, and suggest appropriate tests for the testing of the hypotheses. (I'm sorry, this is all the information I was given for the answer!)
Orthohypotension why? Blood Pressure 120/80 mmHg, Heart Rate 110/min - Supine; BP 90/60 mmHg; HR Thready...
Orthohypotension why? Blood Pressure 120/80 mmHg, Heart Rate 110/min - Supine; BP 90/60 mmHg; HR Thready - Standing (Patient complains of dizziness upon standing).
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT