Master Theorem Multiple Choice Questions and Answers (MCQs) – 2

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Master Theorem – 2”. 1. Solve the following recurrence using Master’s theorem. T(n) = 4T (n/2) + n2 a) T(n) = O(n) b) T(n) = O(log n) c) T(n) = O(n2log n) d) T(n) = O(n2) 2. Solve the following … Read more

Master Theorem Multiple Choice Questions and Answers

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Master Theorem”. 1. Master’s theorem is used for? a) solving recurrences b) solving iterative relations c) analysing loops d) calculating the time complexity of any code 2. How many cases are there under Master’s theorem? a) 2 b) 3 c) … Read more

Towers of Hanoi using Recursion Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Towers of Hanoi using Recursion”. 1. What is the objective of tower of hanoi puzzle? a) To move all disks to some other rod by following rules b) To divide the disks equally among the three rods by following rules … Read more

Data Structure Questions and Answers – Power of a Number using Recursion in Logn Time

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Power of a Number using Recursion in Logn Time”. 1. What will be the output for following code? #include<stdio.h> int func(int x, int y) { if (y == 0) return 1; else if (y%2 == 0) return func(x, y/2)*func(x, y/2); … Read more

Data Structure Questions and Answers – Search an Element in a Linked List using Recursion

This set of Data Structure Questions and Answers for Entrance exams focuses on “Search an Element in a Linked List using Recursion”. 1. Which of the following methods can be used to search an element in a linked list? a) Iterative linear search b) Iterative binary search c) Recursive binary search d) Normal binary search … Read more

Data Structure Questions and Answers – Search an Element in an Array using Recursion – 2

This set of Data Structure Quiz focuses on “Search an Element in an Array using Recursion – 2”. 1. What is the output of the following code? #include<stdio.h> int recursive_search_num(int *arr, int num, int idx, int len) { if(idx == len) return -1; if(arr[idx] == num) return idx; return recursive_search_num(arr, num, idx+1, len); } int … Read more

Data Structure Questions and Answers – Search an Element in an Array using Recursion – 1

This set of Data Structure Multiple Choice Questions & Answers (MCQs) focuses on “Search an Element in an Array using Recursion – 1”. 1. Which of the following techniques can be used to search an element in an unsorted array? a) Iterative linear search b) Recursive binary search c) Iterative binary search d) Normal binary … Read more

Data Structure Questions and Answers – Largest and Smallest Number in a Linked List using Recursion

This set of Data Structure online quiz focuses on “Largest and Smallest Number in a Linked List using Recursion”. 1. Which of the following methods can be used to find the largest and smallest number in a linked list? a) Recursion b) Iteration c) Both Recursion and iteration d) Impossible to find the largest and … Read more

Data Structure Questions and Answers – Largest and Smallest Number in an Array using Recursion

This set of Data Structure online test focuses on “Largest and Smallest Number in an Array using Recursion”. 1. Which of the following methods can be used to find the largest and smallest element in an array? a) Recursion b) Iteration c) Both recursion and iteration d) No method is suitable 2. Consider the following … Read more