Asymptotic Worst Case Time Complexity questions

Q17

GATE CS 2024 CS-1Algorithm AnalysisMCQ1 mark−1/3 if wrong
Given an integer array of size N, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is
Show answer without attempting

Answer: A

Q42

GATE CS 2024 CS-1Algorithm AnalysisMCQ2 marks−2/3 if wrong
Consider the following recurrence relation:
T(n)={nT(n)+nfor n≥1,1for n=1.T(n) = \begin{cases} \sqrt{n}T(\sqrt{n}) + n & \text{for } n \ge 1, \\ 1 & \text{for } n = 1. \end{cases}
Which one of the following options is CORRECT?
Show answer without attempting

Answer: A

0/20 correct0 marks