Which of the following sorting algorithms in its typical implementation gives best performance when applied on an array which is sorted or almost sorted (maximum one or two elements are misplaced)?
Asked in APSC 66 12/ Junior Manager (Electrical / Mechanical / IT/ INSTRUMENTATION) , in Assam Power Generation Corporation Limited (APGCL) (Advt. No. 12/, dtd 25-04-) ELECTRICAL ENGINEERING ME 2023
Show answer
Answer: D. Insertion sort
More APSC Prelims previous year questions questions
- Consider a B+ tree in which the maximum number of keys in a node is 5. What is the minimum number of keys in any non-root node?
- The data structure required to check whether an expression contains a balanced parenthesis is
- Which data structure is needed to convert infix notation to postfix notation?
- What is the value of the postfix expression 6324+_*?
- Which type of data structure is a ternary heap?
- In simple chaining, what data structure is appropriate?
- What are the outputs of the following Java code? public class array { public static void main (string args[][]) { int[] arr = {1, 2, 3, 4, 5}; system.out.println(arr[2]); system.out.println(arr[4]); } }
- What is the advantage of a hash table as a data structure?