0% found this document useful (0 votes)
35 views

Practice Question of ADA

The document contains 18 practice questions related to algorithms and data structures. The questions cover topics like asymptotic notation, algorithm design, analysis of sorting algorithms, recursion, searching and string matching algorithms.

Uploaded by

Sameer Najam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Practice Question of ADA

The document contains 18 practice questions related to algorithms and data structures. The questions cover topics like asymptotic notation, algorithm design, analysis of sorting algorithms, recursion, searching and string matching algorithms.

Uploaded by

Sameer Najam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Practice Question of ADA

Note: It's just a practice set. You will find similar questions, not exact ones. So, practice as much as you
can.
1. Write a short note on Asymptotic Notations and write down their properties
2. What a short note on Data structure, Algorithm, Pseudocode and programming
3. Explain different types of algorithmic approaches and What are the steps you will follow to design an
algorithm
4. Write down the pseudocode of the factorial of n numbers and create the best-case and worst-case
recurrence relation.
5. Compare merge sort, quick sort, and heap sort
6. Arrange the following functions in increasing asymptotic order:

7. Analysis of recursively implemented Fibonacci series with non-recursively implemented Fibonacci


series?
8. What is the time complexity of the tower of Hanoi problem with N-disks
9. A machine needs a minimum of 2 sec to sort 10 elements by merge sort. What is the minimum and
maximum time needed to sort 100 elements approximately?
10. Calculate the time complexity of finding the duplicate number in an array and write down its
pseudocode
11. Write the pseudocode of the binary search algorithm and generate the recurrence relation from it
12. Apply bubble sort, insertion sort, counting sort, heap sort, quick sort, and merge sort on the following
array: 15,25,20,22,30,10,1,9,15,50 and write pseudocode of each and analyze their time complexity.
13. Explain how pivot location affects on time complexities of the quick sort algorithm
14. Explain Stassen’s matrix multiplication and analyze the time complexity.
15. Write a pseudocode to find the smallest number using divide and conquer
16. Consider two arrays A and B of size n and m respectively. Each element of A is mapped with 2 elements
of B. But there is only one element in A which is mapped with only one element in B. How do you find
that element which is mapped only once in a linear time complexity?
17. Practice the Substitution method, recursive tree method, and master theorem on the following:
i) F(n)=n∗F(n−1)
ii) T(n) = 1, when n=1
=1+T(n-1) when n>1
iii) Fn=Fn−1+Fn−2.
iv) T(n)=4T(n/2)+n^2
v) T(n)=2T(n/2)+n

vi)

18. Write down the pseudocode of the Naïve string matching problem and apply both naïve and KMP to
find how many comparisons are required to find the match in the given text and pattern
Text: AACBBABXYABBACAYXACABAAXBYACBYAAXBAA
Pattern: CABAAXBYA

You might also like