Roll No
PRESIDENCY UNIVERSITY
BENGALURU
SCHOOL OF ENGINEERING
END TERM EXAMINATION - MAY 2024
Semester : Semester IV - B.Tech EEE - 2022 Date : Jun 10, 2024
Course Code : CSE2001 Time : 7:30 AM - 10:30 AM
Course Name : Sem IV - CSE2001 - Data Structures and Algorithms Max Marks : 100
Program : B.Tech. Electrical and Electronics Engineering Weightage : 50%
Instructions:
(i) Read all questions carefully and answer accordingly.
(ii) Question paper consists of 3 parts.
(iii) Scientific and non-programmable calculator are permitted.
(iv) Do not write any information on the question paper other than Roll Number.
Part - A
Answer any 5 questions 5 x 4M= 20M
1. What are the disadvantages of Linear Search and show how it can be resolved ?
(CO1) [Knowledge]
2. What is Abstract Data type and list out different ADT's?
(CO1) [Knowledge]
3. List the basic rules for converting an infix expression to a postfix expression
(CO1) [Knowledge]
4. What is the difference between a queue and a stack?
(CO1) [Knowledge]
5. What is Linked list and list out the types of Linked List?
(CO1,CO4) [Knowledge]
6. List the components of a tree node and What is the root of a tree?
(CO1,CO4) [Knowledge]
7. What is the time complexity of an algorithm?
(CO1,CO3) [Knowledge]
Part - B
Answer any 4 questions 4 x 10M = 40M
8. Illustrate a scenario where a stack data structure would be preferable over other data structures
(CO1,CO2) [Comprehension]
9. Explain the concept of a stack data structure and its primary operations.
(CO4,CO3) [Comprehension]
10. Explain the types of Queues
(CO3,CO2,CO4) [Comprehension]
11. Explain the process of inserting an element into a circular linked list and how it differs from insertion in
a linear linked list.
(CO4,CO1,CO2,CO3) [Comprehension]
12. Write an algorithm to implement selection sort with suitable example
(CO1,CO4,CO2,CO3) [Comprehension]
13. Explain the concept of tree traversal and its types
(CO1,CO2,CO3,CO4) [Comprehension]
Part - C
Answer any 2 questions 2 x 20M = 40M
14. A movie rating website stores ratings in a sorted list. Users want to find specific ratings quickly.
1. Finding a Specific Rating:
Scenario: A user wants to find the rating 8.5 in the list of movie ratings.
Handling a Rating Not in the List:
Scenario: A user searches for the rating 9.5, which does not exist in the list.
Develop the above scenario using Java Program and caluculate it's Time Complexity for all
the cases
(CO3,CO1,CO2) [Application]
15. A to-do list app uses a singly linked list to manage tasks. Each node contains the task description and
a pointer to the next task.
1. Adding a Task to the To-Do List:
Scenario: A new task "Buy groceries" needs to be added to the end of the to-do list.
Write the code to append a new task to the end of the singly linked list. Explain how you find
the end of the list.
Removing a Task from the To-Do List:
Scenario: The task "Finish homework" needs to be removed from the to-do list.
Write the code to remove a task from the to-do list. Explain how you handle the pointers to
maintain the list structure.
(CO1,CO2,CO3) [Application]
16. Imagine you are tasked with developing a Java program to manage a Singly-linked list. Your goal is to
create
an empty doubly-linked list and perform specific operations on it. Consider the following tasks:
a. Implement a Java program that defines a Singly-linked list structure.
b. Create an empty singly-linked list.
c. Insert the values 7, 14, and 21 at the beginning of the list.
d. Display the elements of the list from head to tail.
Now, demonstrate your understanding by providing the Java code for the described scenario. Explain
your implementation choices and how your code effectively achieves the required tasks.
(CO1,CO4,CO2) [Application]