...
Question 1228 – Nielit STA [02-12-2018]
November 5, 2023
Database-Management-System
November 5, 2023
Question 1228 – Nielit STA [02-12-2018]
November 5, 2023
Database-Management-System
November 5, 2023

Question 1229 – Nielit STA [02-12-2018]

Given an random unsorted array ‘A’ in which every element is at most ‘d’ distance from is position in sorted array where d<Size(A). If we applied the insertion sort over this array, then the time complexity of algorithm is:

Correct Answer: D

Question 9 Explanation: 
→ Using insertion sort worst case time complexity is O(n2).
→ They are asking to find the atmost distance from every element. So, it will take O(n2*d) from every node.
Note: Using heap sort , time complexity will be O(nlogd) and most effective than insertion sort.
A
O(nlogd)
B
O(n2 logd)
C
O(nd)
D
O(n2d)
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!