Quiz Space

Programming, Data Structures and Algorithms using Python · Quiz 1 · 19 Jul 2026 · May 2026 term

Question 7: Consider the following partition algorithm used in Quicks…

Question 7

+3 marksOne correct option

Consider the following partition algorithm used in Quicksort. The algorithm takes a list and two 0-based indices, and , and uses the first element as the pivot.

Suppose the partition algorithm is called as:

After one complete execution of , what will be the state of the list ?

Consider the following partition algorithm used in Quicksort. The algorithm takes a list  and two 0-based indices,  and
Consider the following partition algorithm used in Quicksort. The algorithm takes a list  and two 0-based indices,  and
  1. A

    —

  2. B

    —

  3. C

    —

  4. D

    —

Show answer

Correct answer

  • D

    —

Question 7 of 16 in the IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 1 paper sat on 19 Jul 2026, in the May 2026 term (Programming, Data Structures And Algorithms Using Python 16 Jul 26). It carries 3 marks.

More questions from this paper

  1. Q1Consider the following Python function: If the function is called as: What value will the function return?
  2. Q2Inscript Consider a connected undirected graph with vertices and edges. What is the minimum number of edges that must b…
  3. Q3Consider the following function: What is the asymptotic running time of the function?
  4. Q4We have an input list of two-dimensional points: We sort these in ascending order by the second coordinate. Which of th…
  5. Q5Consider the following standard implementation of the Insertion Sort algorithm: Suppose you pass a list L containing ex…
  6. Q6You are given a non-empty list of integers with a specific structural property: all odd numbers appear before all even …
  7. Q8Let Q be an initially empty queue that supports the standard queue operations Enqueue and Dequeue. The following sequen…
  8. Q9Consider the following Python function for cycle detection in an undirected graph represented using an adjacency list. …
  9. Q10Consider a connected, directed graph on which Depth First Search (DFS) is executed. For an edge in , let the following …
  10. Q11Consider the following functions: • • • Which of the following is/are True?
  11. Q12Consider the following linked list structure, where each node is an object of the given class and it has a pointer that…
  12. Q13Let be a connected, undirected graph, and let be a Breadth-First Search (BFS) tree generated by running BFS on starting…
  13. Q14Consider the following Directed Acyclic Graph(DAG): Identify the valid topological ordering(s)
  14. Q15Consider the following implementation of the function, which merges two sorted lists into a single sorted list: Let fou…
  15. Q16A hash table with 8 slots (indexed to ) uses open addressing with linear probing ( ). After inserting 5 keys, the curre…