Question 4 John and Jonathan have found an array arr[5] = {67, 12, 90, 23, 34}.
Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.
John and Jonathan have found an array arr[5] = {67, 12, 90, 23, 34}. Both of them want to sort it.
John uses selection sort and counts that for how many times the outer loop has run and stores the count in x1.
Jonathan uses modified bubble sort and counts that for how many times the outer loop has run and stored the count in x2.
What will be the value of (x2 - x1)?
Show answer & explanation
Answer: A. A) 1
Verified technical evaluation based on core computer science and mathematical principles.
Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.