Awesome q2a theme
0 votes
64 views
Consider a sequence A of length n which is
sorted except for one item that appears out of order.Which of the following can sort the
sequence in O(n) time?

(a) Heap sort
(b) Quick sort
(c) Merge sort
(d) Insertion sort
in Algorithms by (9 points) | 64 views

1 Answer

0 votes

Insertion sort works best for nearly sorted or almost sorted array and gives the time complexity of $O(n)$ . So answer should be d


If found helpful, UPVOTE and mark ans as the BEST ANSWER (by clicking the blue tick on the left side of the ans). This motivates me to ANSWER YOUR QUESTIONS IN FUTURE

by (1.7k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users May 2020
  1. Kushagra गुप्ता

    97 Points

  2. praveen modala

    15 Points

  3. ramcharantej_24

    15 Points

  4. abhishek tiwary

    12 Points

  5. srestha

    12 Points

  6. Dtiwari

    9 Points

  7. Shivateja MST

    8 Points

  8. ankitgupta.1729

    8 Points

  9. Rashimdixit

    7 Points

  10. Bhavya1902

    7 Points

7,376 questions
1,741 answers
10,682 comments
90,352 users