Professional Documents
Culture Documents
Analysis of Algorithms
Course Code- CSE 230
Continuous Assessment-I
Important Guidelines
3. Every attempted sheet/page should carry clear details of student such as Name, Registration
number, Roll number, Question number and Page number. The page numbers should be
written clearly on the bottom of every attempted sheet in a prescribed format as: for page 1;
Page 1 of 4, for page 2; Page 2 of 4, for page 3; Page 3 of 4 and for page 4; Page 4 of 4, in case
your assignment/document is of 4 pages.
4. After attempting the answer(s) file has to be submitted to Mr. Aman Kumar personally.
5. This PDF file should be uploaded onto the UMS interface on or before the last date of
the submission.
6. Refrain from indulging into plagiarism as copy cases will be marked zero.
7. This Document contains multiple sets of papers. The allocation sheet is also attached in
the CA file. All the students are advised to attempt the Set allocated to him/her.
[10]
2. Explain which technique consecutively search the next value till it reaches the end of
element and the worst-case complexity is O(n), and apply on the given elements and search key
value=3
Input [1]: 1 5 2 7 3 4 8 6 [10]
3.Calculate and explain the complexity of binary search from its algorithm. [10]
4. Write a program to implement the concept of Divide and Conquer strategy by taking one
example. [10]
5. Write a program to implement the concept of Recursion using Tower of Hanoi. [10]
Design and Analysis of Algorithms(CSE-230) CA-1
Set-2
1. What are asymptotic Notations? How are notations playing an important role in Algorithms.
[10]
2. Explain which technique, the element is always searched in the middle of a portion of an
array and the worst-case complexity is O(log n). and apply on the given elements and search
key value=3
Input [1]: 1 3 5 6 7 9 11 15 16 [10]
3. Write a program to implement the concept of Divide and Conquer strategy by taking one
example [10]
4. Calculate and explain the complexity of linear search from its algorithm. [10]
5. Write a program to implement the concept of Fibonacci series using Recursion. [10]
Design and Analysis of Algorithms(CSE-230) CA-1
Set-3
1. Explain the concept of Best Case, Average case and Worst Case. Justify each with
Example. [10]
2. a) Write an algorithm for Binary Search. [5]
b) Do comparative analysis of Linear Search and Binary Search. [5]
3.The given sequence is [2,25,255,267,300,807]. Write a program and follow the most
optimized way to search an element (267) in the given sequence. [10]
4.Consider 3 towers (Source, Helper, Destination). Write a program to move 5 disks from
source tower to destination tower using Recursion only. [10]
5. Write a program to implement the concept of Fibonacci series using Recursion only. [10]
Design and Analysis of Algorithms(CSE-230) CA-1
Set-4
4. Write a Program in java to demonstrate the concept of Recursion using Tower of Hanoi.
[10]
class Q
int temp;
temp = x
y=X
y= temp;
intx = 100;
int y= 10;
Swap(x, y);
You are given a string and you have to print the reverse of the string using a stack.
Input Format
A string which has to be reversed.
Output Format
The reverse of the input string
Sample Input 1:
abcd
Sample Output 1:
dcba
Sample Input 2:
abcdef
Sample Output 2:
fedcba
7. Write a java program to find the square root of a number using a binary search. [10]
Design and Analysis of Algorithms(CSE-230) CA-1
Set-5
4 Write a program to implement the concept of Divide and Conquer strategy by taking any 1
example. [10]
5. Complete the following function: [10]
public class Main
{
public static void Hanoi(int n, String src, String helper, String dest){
Registration
Sr. No Name of the Student Roll Number Set Allocation
Number
Mallikarjuna Reddy
SET-2
68 12102343 Gopireddy RK21PUB68