Algorithms - Time Complexity
GATE CSE & IT · 3 questions across 2 years (2017-2024) · 5% recurrence rate
Recurrence sparkline
2017–2024201720212024
Difficulty mix
easy 33%
med 33%
hard 33%
Question types
MCQ2
MTF1
All 3 questions on Algorithms - Time Complexity
2024 Q17
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 o...
Easy✓
2017 Q3
Match the algorithms with their time complexities: Algorithm (P) Towers of Hanoi with n disks (Q) Binary search given n sorted numbers (R) Heap sort given n numbers at the worst case (S) Addition of two n x n matrices Ti...
Med✓
2017 Q38
Consider the following C function. ```c int fun(int n) { int i, j; for (i = 1; i <= n; i++) { for (j = 1; j < n; j += i) { printf("%d %d",i,j); } } } ``` Time complexity of fun in terms of $\Theta$ notation is
Hard✓