Topic: Sorting | BPSC Paper-2 Computer Science Notes

 sorting

Summary notes on topic "Sorting"

-------------------++++++++-----------

• The process of placing or rearranging a collection of elements into a particular order is known as sorting.

• Bubble sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements in case they are unordered in n-1 passes.

• In Selection Sort, the smallest element is selected from the unsorted array and swapped with the leftmost element, and that element becomes a part of the sorted array. The process continues for the next element in the unsorted array till the list is sorted.

• Insertion Sort places the element of a list at its suitable place in each pass. It is similar to the placing of cards at its right position while playing cards.

• Complexity analysis is performed to explain how an algorithm will perform when the input grows larger.

MCQ Qu-Ans on Topic Sorting

Qu: Which of the following is not a stable sorting algorithm?







Qu: Which of the following is a stable sorting algorithm?







Qu: Which of the following is not an in-place sorting algorithm?







Qu: Running merge sort on an array of size n which is already sorted is







Qu: The time complexity of a quick sort algorithm which makes use of median, found by an O(n) algorithm, as pivot element is







$ads={1}

Qu: Which of the following is not a noncomparison sort?







Qu: The time complexity of heap sort in worst case is







Qu: If the given input array is sorted or nearly sorted, which of the following algorithm gives the best performance?







Qu: Which of the following algorithm pays the least attention to the ordering of the elements in the input list?







Qu: Consider the situation in which assignment operation is very costly. Which of the following sorting algorithm should be performed so that the number of assignment operations is minimized in general?







Qu: Time complexity of bubble sort in best case is







Qu: Given a number of elements in the range [0….n3]. which of the following sorting algorithms can sort them in O(n) time?







Qu: Which of the following algorithms has lowest worst case time complexity?







Qu: Which of the following sorting algorithms is/are stable







Qu: Counting sort performs …………. Numbers of comparisons between input elements.







Qu: The running time of radix sort on an array of n integers in the range [0……..n5 -1] when using base 10 representation is







Qu: The running time of radix sort on an array of n integers in the range [0……..n5 -1] when using base n representation is







$ads={2}

Qu: Which of the following sorting algorithm is in-place







Qu: The radix sort does not work correctly if each individual digit is sorted using







Qu: Which of the following sorting algorithm has the running time that is least dependant on the initial ordering of the input?







Qu: Time complexity to sort elements of binary search tree is







Qu: The lower bound on the number of comparisons performed by comparison-based sorting algorithm is







Qu: Which of the following algorithm(s) can be used to sort n integers in range [1…..n3] in O(n) time?







Qu: Which of the following algorithm design technique is used in the quick sort algorithm?







Qu: Merge sort uses







Qu: For merging two sorted lists of size m and n into sorted list of size m+n, we require comparisons of







Qu: A sorting technique is called stable if it







Qu: In a heap with n elements with the smallest element at the root, the seventh smallest element can be found in time







Qu: What would be the worst case time complexity of the insertion sort algorithm, if the inputs are restricted to permutation of 1…..n with at most n inversion?







Qu: In a binary max heap containing n numbers, the smallest element can be found in time







Post a Comment

Thanks for your best idea after moderation comment published here.

Previous Post Next Post