Question 26
Average and Worst-case time complexity of Merge Sort is -
Merge Sort consistently divides arrays into halves (log n steps) and merges sub-lists in O(n) work, giving O(n log n) performance across all cases.
Average and Worst-case time complexity of Merge Sort is -
Merge Sort consistently divides arrays into halves (log n steps) and merges sub-lists in O(n) work, giving O(n log n) performance across all cases.
Which sorting algorithm repeatedly passes through the list, compares adjacent elements, and swaps them if out of order?
Bubble Sort compares adjacent element pairs continuously, bubbling larger values towards the end of the array in each iteration.
Which sorting algorithm builds the final sorted array one item at a time, similar to playing card insertion?
Insertion Sort iterates over elements, shifting greater values rightward to insert each key into its correct position within the sorted prefix.
The minimum number of comparisons needed to find the minimum element in an unsorted array of size N is -
An algorithm must identify which of the N elements is smallest. In the comparison model, each of the other N-1 elements must lose at least one comparison to establish the minimum, so exactly N-1 comparisons are sufficient and necessary.
A graph traversal technique that uses a Queue data structure is -
BFS explores graph vertices level-by-level starting from a source node, utilizing a FIFO Queue to manage pending adjacent vertices.