Arrange the following in the ascending order of their time complexity.
(A) Worst Case of Linear Search
(B) Best Case of Binary Search
(C) Worst Case of Binary Search
(D) Worst Case of Bubble Sort
Choose the correct sequence from the options given below:
To arrange the given algorithms by their time complexity, we consider the following complexities for each case:
Now, we arrange these complexities in ascending order:
Therefore, the sequence in terms of their time complexities from the smallest to the largest is: (B), (A), (C), (D)
The correct ascending order of time complexity is (B), (A), (C), (D).
Additional Context:
Correct Answer: (3) (B), (A), (C), (D).
Given the following table:
| ENO | SALARY |
|---|---|
| A101 | 4000 |
| B109 | NULL |
| C508 | 6000 |
| A305 | 2000 |
State the output of the following query:
SELECT COUNT(SALARY) FROM EMPLOYEE;
| List-I (Aggregate function) | List-II (Description) |
|---|---|
(A) count(marks) | (III) Count all non null values of marks column |
(B) count() | (I) Count all rows |
(C) avg(marks) | (II) Finding average of non null values of marks |
(D) sum(marks) | (IV) Finding sum of all marks |
Give the output of the query: SELECT MONTH("2010-03-05");