0% found this document useful (0 votes)
68 views13 pages

Set Cse Ca 1

1. The document provides guidelines and instructions for the Continuous Assessment-I exam for the course Design and Analysis of Algorithms with course code CSE 230. 2. Students must attempt 3 out of 5 questions in handwritten form on paper and submit their work to the instructor by the due date. 3. The document includes 6 sets of exam questions and assigns each student to a specific set based on their registration number to avoid plagiarism.

Uploaded by

Bhumika Biyani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views13 pages

Set Cse Ca 1

1. The document provides guidelines and instructions for the Continuous Assessment-I exam for the course Design and Analysis of Algorithms with course code CSE 230. 2. Students must attempt 3 out of 5 questions in handwritten form on paper and submit their work to the instructor by the due date. 3. The document includes 6 sets of exam questions and assigns each student to a specific set based on their registration number to avoid plagiarism.

Uploaded by

Bhumika Biyani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Course Name- Design and

Analysis of Algorithms
Course Code- CSE 230
Continuous Assessment-I
Important Guidelines

1. Attempt any three questions out of 5.

2. It is mandatory to attempt all questions of the assignment in your own handwriting on A4


size sheets/pages with a blue color ink pen. Any other mode of attempt (typed or printed codes
or table) except handwritten/drawn will not be accepted/considered as valid submission(s)
under any circumstances.

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.

8. If any student found indulge in malpractices like plagiarism from internet or


classmates, attempting wrong set of question paper or any other, will be awarded
with zero (0) marks in CA.
Design and Analysis of Algorithms(CSE-230) CA-1
Set-1
1. Explain the concept of Best Case, Average case and Worst Case of the given algorithm
below:

[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

1. What is the Abstract Data Type explain in detail with examples.


[2]
2.i) In the worst case, the number of comparisons needed to search a singly linked list of length
n for a given element is. [1]

ii) Consider the following three functions.


f1 = 10n, f2 = nlogn, f3 = n√n
Which one of the following options arranges the functions in the increasing order of asymptotic
growth rate? [2]

3. Write a program to sort the Stack in Descending order using:


i) Temporary stack [10]
ii) Recursion
iii) Compare the time and Space Complexity between i) and ii)

4. Write a Program in java to demonstrate the concept of Recursion using Tower of Hanoi.
[10]

5. What would be the output of the following code? [5]


import java.1o.*

class Q

public static void swap(int x, int y)

int temp;

temp = x

y=X

y= temp;

System.out.print(x+" " + y);

public static void main(String[] args)

intx = 100;

int y= 10;
Swap(x, y);

6. Reverse a string using a stack. [10]

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

1.Answer the following from the code given below:


//Searches for a given value in a given array by sequential search
//Input: An array A[0..n − 1] and a search key K
//Output: The index of the first element in A that matches K
// or −1 if there are no matching elements
i←0
while i<n and A[i] = K do
i←i+1
if i<n return i
else return −1
i) Find the worst-case efficiency [2]
ii) Find the best-case efficiency [2]
iii) Find the average-case efficiency [1]
2. What are the complexity functions explain with examples. [10]
3. Explain the algorithms of
i)Bubble sort and give a suitable example. [10]
ii)Selection Sort and give a suitable example. [10]
4. Write a program to demonstrate linear Search and its java implementation. [10]
5.For each of the following algorithms, indicate (i) a natural size metric for its inputs, (ii) its
basic operation, and (iii) whether the basic operation count can be different for inputs of the
same size:
a. computing the sum of n numbers
b. computing n!
c. finding the largest element in a list of n numbers [5]
Design and Analysis of Algorithms(CSE-230) CA-1
Set-6
1. What are asymptotic Notations. How are notations playing an important role in
Algorithms. [10]
2. a) Justify the time complexity of Binary Search with example. [5]
b) Calculate the time complexity for the following case: [5]
void fun(int n){
for(i=1;i<n;i=i*2)
System.out.println(“The Time complexty is:”);
}
3. The given sequence is [901,708,1000,234,34,57]. Write a program and follow the most
optimized way to search an element (234) in the given sequence. [10]

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){

//Write your Code Here….


}
public static void main(String[] args) {
int n;
Scanner input= new Scanner(System.in);
System.out.println("Enter no of disks");
n=input.nextInt();
Hanoi(n,"S","H","D");
}
}
Student List with Assigned Sets

Registration
Sr. No Name of the Student Roll Number Set Allocation
Number

1 12112031 Vanshika Agarwal RK21HCA01 SET-1

2 12113531 Rayan Rafeek RK21HCA02 SET-2

3 12113626 Anuj Shrivatri RK21HCA03 SET-3

4 12109323 Khushi Choudhary RK21HCA04 SET-4

5 12108725 Dharani K S RK21HCA05 SET-5

6 12107941 Peyyala Akshay Mathew RK21HCA06 SET-6

Madireddy Bharath Kumar


SET-1
7 12107901 Reddy RK21HCA07

8 12108642 Aditya Parashar RK21HCA08 SET-2

9 12106295 Shalvin K RK21HCA09 SET-3

10 12106835 Alan J Thomas RK21HCA10 SET-4

11 12101368 Jugraj Singh Pelia RK21HCA11 SET-5

12 12101758 Balireddy Madhava Reddy RK21HCA12 SET-6

13 12104709 Charanjeet Singh RK21HCA13 SET-1

14 12104652 Alexander Peter Maliyakkal RK21HCA14 SET-2

15 12100252 Promise Mutum RK21HCA15 SET-3

16 12100847 Latchi Gnana Prakash RK21HCA16 SET-4

17 12107890 Sanjana Umrao RK21HCA17 SET-5

18 12108274 S Yuvraj RK21HCA18 SET-6

19 12109124 Tarushi Lawania RK21HCA19 SET-1

20 12109373 Mabel Blossom RK21HCA20 SET-2

21 12114325 Aman Verma RK21HCA21 SET-3

22 12103064 Bejjanki Sathvik Rao RK21HCA22 SET-4


23 12106900 Shreyas Krishnan RK21HCA23 SET-5

24 12107046 Aniket Panda RK21HCA24 SET-6

25 12100191 Vishal Viswanathan RK21HCA25 SET-1

26 12100248 Priyansh Sharma RK21HCA26 SET-2

27 12100915 Nived Suresan A RK21HCA27 SET-3

28 12100958 Ansh Chourasia RK21HCA28 SET-4

Chikkam Chiranjeevi Sai


SET-5
29 12101273 Murari RK21HCA29

30 12109322 Rohit SInha RK21HCA30 SET-6

31 12103357 Ayush Raj Singh RK21HCA31 SET-1

32 12104759 Sakthi Bala RK21HCA32 SET-2

33 12105160 Gopal Gupta RK21HCA33 SET-3

34 12106448 Shaik Uzma RK21HCA34 SET-4

35 12111724 Shahriar Mumin Khan RK21HCA35 SET-5

36 12113650 Patlolla Hariharanreddy RK21HCA36 SET-6

37 12100343 Chirravuri Krishna Chaitanya RK21HCB37 SET-1

38 12104494 Gunturu Uday Varma RK21HCB38 SET-2

39 12102845 Ankur Banerjee RK21HCB39 SET-3

40 12107228 Jai Chaudhary RK21HCB40 SET-4

41 12105751 Garvita Aggarwal RK21HCB41 SET-5

42 12106234 Vulli B M S Pruthvi RK21HCB42 SET-6

43 12107820 Kaushambi Chauhan RK21HCB43 SET-1

44 12107854 Vinay Dadheech RK21HCB44 SET-2

45 12107863 Dyuti Pati RK21HCB45 SET-3

46 12107597 Akshat Keshari RK21HCB46 SET-4


47 12107568 Kotte Narasimha Reddy RK21HCB47 SET-5

48 12107503 Mohammad Sahir Baig RK21HCB48 SET-6

49 12109549 Pallanti Asrith Vatsal RK21HCB49 SET-1

50 12113396 Abhishek Kumar Singh RK21HCB50 SET-2

51 12112234 Dadireddy Sidhanth Reddy RK21HCB51 SET-3

52 12112315 Bhumika Biyani RK21HCB52 SET-4

53 12112397 Santosh James Kalyani RK21HCB53 SET-5

54 12109922 Divyanshi Sharma RK21HCB54 SET-6

Marlakunta Kedhareswer
SET-1
55 12110626 Naidu RK21HCB55

56 12112382 Manchem Vishnu Srikar RK21HCB56 SET-2

57 12113072 Aniket Sharma RK21HCB57 SET-3

58 12113332 Shubham Kumar Gupta RK21HCB58 SET-4

59 12107516 Muskan Kaushal RK21HCB59 SET-5

60 12107533 Ayush Raj RK21HCB60 SET-6

61 12107776 Lakshya Sharma RK21HCB61 SET-1

62 12110965 Anindita Pandit RK21HCB62 SET-2

Daryl Simon Dominic


SET-3
63 12102833 Fernandes RK21HCB63

64 12100583 Sunkari Vedavyas RK21HCB64 SET-4

65 12107787 Sajja Aditya RK21HCB65 SET-5

66 12105016 Shravani Deshpande RK21HCB66 SET-6

67 12109427 Gopeenandan B R RK21HCB67 SET-1

68 12109470 Abimanyu S RK21HCB68 SET-2

69 12110498 Anubhav Tiwari RK21HCB69 SET-3

70 12112410 Nikhil Kaundal RK21HCB70 SET-4


71 12113048 Nitin Kumar Mundhra RK21HCB71 SET-5

72 12102420 Shubham Sony RK21HCB72 SET-6

73 12016474 Kottakota Venkata Ramana RK21HCB73 SET-1

You might also like