0% found this document useful (0 votes)
10 views3 pages

Fall 24

This document outlines the mid-exam for the B.Sc. in Computer Science & Engineering course CSE 2215, focusing on Data Structures and Algorithms. It includes various questions on time complexity, sorting algorithms, memory allocation, linked lists, and data structures for text editor features. The exam is scheduled for Fall 2024, lasting 1 hour and 30 minutes, with a total of 30 marks available.

Uploaded by

shuvra098
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)
10 views3 pages

Fall 24

This document outlines the mid-exam for the B.Sc. in Computer Science & Engineering course CSE 2215, focusing on Data Structures and Algorithms. It includes various questions on time complexity, sorting algorithms, memory allocation, linked lists, and data structures for text editor features. The exam is scheduled for Fall 2024, lasting 1 hour and 30 minutes, with a total of 30 marks available.

Uploaded by

shuvra098
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/ 3

United International University

B.Sc. in Computer Science & Engineering (CSE)


CSE 2215: Data Structure and Algorithms-I
Mid Exam: Fall 2024 Time: 1 Hour 30 mins Marks: 30
Any evidence of plagiarism or copy will be punishable according to the proctorial rules of UIU

Answer all of the following questions.

1. (a) Consider the following function ”FuncA”. Find the time Complexity of the function using
asymptotic notation. [4]

2. (a) How many element comparisons are needed for the following instance of the Descending
Order Quick Sort to find the first and second partitioning elements? [3]
16 23 19 28 7 11 19 12 21
(b) You are given an array A = { 5, 2, -2, -2, 4, -3, -5, 4, 5, 3, -1, 2 }. Each element in the
array ranges from -5 to 5. Sort the array using the Counting Sort algorithm, and clearly
illustrate the intermediate steps of the cumulative sum array [3]

3. (a) Consider a memory system with row-wise memory allocation, a double array X[128][64]
where each double is 8 bytes. let X[20][10] = m + 50000 where m is the last 2 digits of your

1
student id.[Example; if student id = 0112410261 ,then m = 61] Calculate the memory
address of beginning of the array and X[22][15]. [4]
(b) If the system was column-wise will there be any changes to the result. Show your
reasoning. [2]

4. The initial state of a Linked List is given below: [6]

Show the effect of executing the following function. Assume that each of the nodes has two
fields; data and next, where data is of integer type and next will contain the address of the
next node.

5. Suppose you are designing a text editor, where you want to implement the features given
below. [3]

(a) Undo operations: remove the last typed character

(b) Redo operations: restore the most recently undone character

Which data structure(s) will you prefer to implement these two features? Briefly explain.

Page 2
6. (a) Consider there is a Stack ”A” that is implemented using ”Singly Linked List”. The
Linked List stores data in node. Now, write pseudocode for ”Push” which adds a node and
”Pop” which removes the last inserted node and removes it from the ”Linked list”. [3]

(b) Consider the following Linked list bellow. If we want to implement a ”Queue” using this
Linked list, Where should ”enqueue” operation add a new node. Justify your answer. [2]

Figure 1: Question: 6

Page 3

You might also like