Question
Analyze best case, average case, and worst-case time complexities of following algorithms with the help of suitable examples.
(i) Insertion sort
(ii) Quick sort
(iii) Binary search
(iv) Selection sort
Answer :
Word Count : 344
(i) Insertion Sort Best Case: When the array is already sorted, each element is compared once. * Time complexity: O(n) * Example: \[1, 2, 3, 4, 5] Average Case: Each element may be compared with half of the sorted subarray. * Time complexity: O(n²) * Example: \[4, 3, 1, 5, 2] Worst Case: When the array is _____ _______ ____ ________ ___.
____ ________ _______ _____ ____ ______ __________ ________ _________ _________ __________ ________.
__________ ________ _______ _________ ______ _________ _______ _____ __________ ______ __________ ___.
_________ ______ ____ ____ ____ ________ _______ __________ ______ ______ _____ _________.
_______ __________ _____ ____ _________ __________ _____.
______ ______ ___ ___ _____ ___.
____ ____ _____ ___ ____ _______ _________ ______ ______ _______ __________ ___.
____ __________ ________ ___ _____ ___ ________ _____ ________ _______.
__________ _______ ________ __________ _________ ___ ________ ___ _____.
_______ __________ ______ _____ ___.
_______ ______ _________ _______ ________ ___ __________ _____ _____ ___ _______ ______.
______ __________ ______ ____ ______ _____.
____ ___ ________ _______ ____ ___ ____.
______ ____ ________ _________ ______ ___ _________ _______ _______.
___ ________ _____ ___ _______ ___ ______ ________ _________.
__________ ____ _________ __________ ___ __________ __________ ___ ____.
_______ ___ ___ _______ ______ ______ ____ ______ _________ _______.
_______ _________ _____ _______ _________ ______ _______ _________ ___ _______ ________.
__________ ______ _____ ________ ______ __________ _____ ___ __________ _______ _______.
_____ _______ _________ _______ ________ _____ ___ __________ __________ _____.
_______ ______ _______ ______ ______ _________ _________ ________ _____ __________ _______ ____.
_________ ____ _________ _____ _________ _______ _________ _______ ______ __________.
________ _____ ______ __________ ______ ________ ____ _______ __________ ______.
________ _________ ___ ______ ___ ____ ____ _________.
__________ __________ ___ _______ _________ _______ ___ __________ ______ ________ _____.
_____ ___ ______ _______ _________ _____.
______ _______ __________ _______ ___ ____ _______.
____ _____ _____ _______ ________ _____ ______ ______ _____.
______ _____ _____ _______ ______ __________ _____.
______ ____ _________ __________ ______ _________ ___ __________ _____ _________.
__________ ___ _______ _____ ________ ____ ____ __________ ____.
__________ ___ ______ ____.
Get Full Answer on WhatsApp
(i) Insertion Sort Best Case: When the array is already sorted, each element is compared once. * Time complexity: O(n) * Example: \[1, 2, 3, 4, 5] Average Case: Each element may be compared with half of the sorted subarray. * Time complexity: O(n²) * Example: \[4, 3, 1, 5, 2] Worst Case: When the array is _____ _______ ____ ________ ___.
____ ________ _______ _____ ____ ______ __________ ________ _________ _________ __________ ________.
__________ ________ _______ _________ ______ _________ _______ _____ __________ ______ __________ ___.
_________ ______ ____ ____ ____ ________ _______ __________ ______ ______ _____ _________.
_______ __________ _____ ____ _________ __________ _____.
______ ______ ___ ___ _____ ___.
____ ____ _____ ___ ____ _______ _________ ______ ______ _______ __________ ___.
____ __________ ________ ___ _____ ___ ________ _____ ________ _______.
__________ _______ ________ __________ _________ ___ ________ ___ _____.
_______ __________ ______ _____ ___.
_______ ______ _________ _______ ________ ___ __________ _____ _____ ___ _______ ______.
______ __________ ______ ____ ______ _____.
____ ___ ________ _______ ____ ___ ____.
______ ____ ________ _________ ______ ___ _________ _______ _______.
___ ________ _____ ___ _______ ___ ______ ________ _________.
__________ ____ _________ __________ ___ __________ __________ ___ ____.
_______ ___ ___ _______ ______ ______ ____ ______ _________ _______.
_______ _________ _____ _______ _________ ______ _______ _________ ___ _______ ________.
__________ ______ _____ ________ ______ __________ _____ ___ __________ _______ _______.
_____ _______ _________ _______ ________ _____ ___ __________ __________ _____.
_______ ______ _______ ______ ______ _________ _________ ________ _____ __________ _______ ____.
_________ ____ _________ _____ _________ _______ _________ _______ ______ __________.
________ _____ ______ __________ ______ ________ ____ _______ __________ ______.
________ _________ ___ ______ ___ ____ ____ _________.
__________ __________ ___ _______ _________ _______ ___ __________ ______ ________ _____.
_____ ___ ______ _______ _________ _____.
______ _______ __________ _______ ___ ____ _______.
____ _____ _____ _______ ________ _____ ______ ______ _____.
______ _____ _____ _______ ______ __________ _____.
______ ____ _________ __________ ______ _________ ___ __________ _____ _________.
__________ ___ _______ _____ ________ ____ ____ __________ ____.
__________ ___ ______ ____.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★