CARVIEW |
Select Language
HTTP/2 200
content-type: text/html; charset=utf-8
date: Tue, 29 Jul 2025 01:47:09 GMT
permissions-policy: interest-cohort=()
strict-transport-security: max-age=31536000; includeSubDomains
server: nginx
cache-control: s-maxage=60944, max-age=0
x-powered-by: Next.js
etag: "14sxcvdb3396ucc"
content-encoding: gzip
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'self' http: https: ws: wss: data: blob: 'unsafe-eval' 'unsafe-inline'; frame-ancestors 'self';
vary: Accept-Encoding
x-cache: Hit from cloudfront
via: 1.1 986eae8d2ce16ac0e906843bfadf310e.cloudfront.net (CloudFront)
x-amz-cf-pop: BOM78-P9
x-amz-cf-id: nevGzE07R8z90CUSp_ALVOb5OmLcYT4lIkr5WYJM3C8vj-xtIYe_bA==
age: 39773
Algorithms | Sorting | Question 5
Algorithms | Sorting | Question 5
Last Updated :
Discuss
Comments
Given an unsorted array. The array has this property that every element in the array is at most k distance from its position in a sorted array where k is a positive integer smaller than the size of an array. Which sorting algorithm can be easily modified for sorting this array and what is the obtainable time complexity?
Insertion Sort with time complexity O(kn)
Heap Sort with time complexity O(nLogk)
Quick Sort with time complexity O(kLogk)
Merge Sort with time complexity O(kLogk)
This question is part of this quiz :
Top MCQs on Complexity Analysis of Algorithms with Answers,Top MCQs on QuickSort Algorithm with Answers,Top MCQs on HeapSort Algorithm with AnswersTags:
Share your thoughts in the comments

GeeksforGeeks
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy