# Bead Sort – Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Bead Sort”.

1. Bead sort is a comparison based sorting algorithm.
A) true
B) false

Explanation: A non-comparison based sorting algorithm is the bead sort. This is due to the fact that it does not equate the values of elements in a list to sort them.

2. How many comparisons will be required to sort the array arr={5, 4, 7, 1, 9} using bead sort?
A) 5
B) 4
C) 6
D) 0

Explanation: A non-comparison based sorting algorithm is the bead sort. As a result, there is no need to perform a comparison in order to sort the list.

3. What is the average time complexity of bead sort (S = sum of input elements)?
A) O(n)
B) O(S)
C) O(n2)
D) O(n log n)

Explanation: Bead sorting has an average case time complexity of O. (S). This is due to the fact that we drop each bead separately.

4. What is the best case time complexity of bead sort (S = sum of input elements)?
A) O(n)
B) O(S)
C) O(n2)
D) O(n log n)

Explanation: The time complexity of bead sorting in the best-case scenario is O. (n). When a row of beads is dropped as a separate operation and the number of rows is equal to n, this is what happens.

5. What is the worst case time complexity of bead sort (S= sum of input elements)?
A) O(n)
B) O(S)
C) O(n2)
D) O(n log n)

Explanation: Bead sorting has a worst-case time complexity of O. (S). This is due to the fact that we drop each bead separately.

6. Which of the following code fragment puts sorted values in an array using beads correctly?
A)

```for (int i = 0; i < n; i++)
{
int j;
for (j = 0; j < max; j++);
//max is the maximum value element of given array a[]
a[i] = j;
i}```

B)

```for (int i = 0; i < n; i++)
{
int j;
for (j = 0; j < max && beads[i * max + j]; j++);
//max is the maximum value element of given array a[]
a[i] = j;
}```

C)

```for (int i = 0; i < n; i++)
{
int j;
for (j = 0; j < beads[i * max + j]; j++);
//max is the maximum value element of given array a[]
a[j] = i;
}```

D)

```for (int i = 0; i < n; i++)
{
int j;
for (j = 0; j < max && beads[i * max + j]; j++);
//max is the maximum value element of given array a[]
a[j] = i;
}```

Explanation: We must eventually move the elements in the bead array back to the original array after sorting them. To accomplish this, we must apply the condition j max && beads[i * max + j].

7. Bead sort is only applicable to positive integers.
A) true
B) false

Explanation: Only positive integers can be sorted using the bead sort algorithm. This is because each row contains the same number of beads as the key value.

8. Bead sort is also known as _________
A) gravity sort
B) strand sort
C) abacus sort
D) counting sort

Explanation: Gravity type is another name for bead sort. This is due to the fact that this algorithm was created with the natural phenomenon of falling objects in mind.

9. Which of the following sorting algorithm was inspired by the natural phenomenon of falling objects?
A) bogo sort
B) heap sort
C) bead sort
D) strand sort

Explanation: The natural phenomenon of dropping objects inspired the bead sort algorithm. As a result, it’s also known as gravity kind.

10. Which of the following sorting algorithm is only applicable to positive integers?
A) quick sort
B) heap sort
C) bead sort
D) strand sort

Explanation: Only positive integers can be sorted using the bead sort algorithm. This is because each row contains the same number of beads as the key value.

11. What is the auxiliary space complexity of bead sort?
A) O(n)
B) O(1)
C) O(n2)
D) O(n log n)

Explanation: Bead sort has an auxiliary space complexity of O. (n2). It’s because an array of size maximum element*n must be preserved (maximum element is the maximum element in the array, and n is the array’s size).

12. Which of the following sorting algorithm is not in place?
A) quick sort
B) bead sort
C) cycle sort
D) heap sort

Explanation: The auxiliary space complexity of the bead type is O. (n2). As a result, it’s not a sorting algorithm that works in real time.

The natural sorting algorithm bead sort, also known as gravity sort, was developed by Joshua J. Arulanandham, Cristian S. Calude, and Michael J. Dinneen in 2002 and published in The Bulletin of the European Association for Theoretical Computer Science. Bead sort can achieve an O(n) sorting time in both digital and analogue hardware; however, software implementations of this algorithm are significantly slower and can only be used to sort lists of positive integers. Furthermore, it appears that the algorithm, even in the best case, requires O(n2) space. A non-comparison based sorting algorithm is the bead sort.