Monday, January 27, 2025
Google search engine
HomeData Modelling & AIAlgorithms | InsertionSort | Question 2

Algorithms | InsertionSort | Question 2

Which is the correct order of the following algorithms with respect to their time Complexity in the best case ?
(A) Merge sort > Quick sort >Insertion sort > selection sort
(B) insertion sort < Quick sort < Merge sort < selection sort
(C) Merge sort > selection sort > quick sort > insertion sort
(D) Merge sort > Quick sort > selection sort > insertion sort

Answer: (B)
Explanation:

In best case, 

Quick sort: O (nlogn) 
Merge sort: O (nlogn)
Insertion sort: O (n)
Selection sort: O (n^2)  

Quiz of this Question

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments