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

DSA Term Test 1

The document is a Term-Test 1 question paper for the B.Tech Computer Science and Engineering program, focusing on Data Structures and Algorithms. It includes instructions for students, a set of questions covering various topics in data structures, and specific course outcomes related to the subject. The test is scheduled for 20/11/2020, with a maximum duration of 1 hour and 15 minutes and a total of 25 marks.
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)
11 views3 pages

DSA Term Test 1

The document is a Term-Test 1 question paper for the B.Tech Computer Science and Engineering program, focusing on Data Structures and Algorithms. It includes instructions for students, a set of questions covering various topics in data structures, and specific course outcomes related to the subject. The test is scheduled for 20/11/2020, with a maximum duration of 1 hour and 15 minutes and a total of 25 marks.
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

Effective from: 09.11.

20’

Faculty of Engineering Technology


Term-Test 1 Question Paper – B.Tech
Department : Computer Science and Engineering
Programme : B Tech.
Semester / Batch : 3/2019
Date of Test : 20/11/2020
Course Code : 19CSC203A
Course Title : Data Structures and Algorithms

Term Test - 1

INSTRUCTIONS TO STUDENTS:
1. Answer all the questions
2. Use only SI units
3. Use of non-programmable scientific calculator is permitted
4. Use of data handbook permitted wherever applicable
5. Missing data may be appropriately assumed
6. Notations used have usual meaning
7. Mail the scanned answer sheets in pdf format within the stipulated time to
[email protected] and [email protected]
Maximum Duration: 1 Hour 15 minutes Maximum Marks: 25

IMPORTANT:
You may retain the question paper for future reference

Q. No. Question Marks CO

1 i. L is a name in a Python program and L is initialized to 5 1,2


[1,2,4,5]. The statement L[2]=0 is not valid as immutability
property of a list is violated. The statement is
a. False
b. True
c. Neither True nor False
d. None of the above

ii. T is a name in a Python program and T is initialized to


(1,2,4,5). The statement T[2]=0 is not valid as immutability
property of a Tuple is violated. The statement is
a. False
b. True
c. meaningless
d. None of the above

iii. Stack is a ________ data structure.


a. First in First Out
b. Last in First Out
c. Sequential
d. Non-sequential

19CSC203A Page 1 of 3
Effective from: 09.11.20’

iv. Binary search algorithm on input list size of 1024 requires


______ as the maximum number of comparisons.
a. 1024
b. 10
c. 1
d. None of the above

v. During the interpretation of (Boolean expression 1) or


(Boolean expression 2), Python
a. Evaluates both expressions always
b. Evaluates both expressions sometimes
c. Evaluates only the first expression
d. None of the above

vi. The output of print str[2:5] if str = ‘Hello World!’ is ______.

a. Hello World
b. hello
c. llo
d. ll

vii. Given an array my_list = {45,77,89,90,94,99,100} and key =


100; the mid values(of corresponding list elements)
generated in the first and second iterations are _________ .
a. 90 and 99
b. 90 and 100
c. 89 and 94
d. 94 and 99

viii. Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], list1 after the
operation list1.pop(1) is _________ .
a. [3,4,5,20,5,25,1]
b. [1, 3, 3, 4, 5, 5, 20, 25]
c. [3, 5, 20, 5, 25, 1, 3]
d. [1, 3, 4, 5, 20, 5, 25]

ix. The output of the following program is __________.


list = [3, 7, 5, 9, 2]
a = iter(list)
print(next(a))

a. 7
b. 5
c. 3
d. 9

x. Values can be added to a Python list using _________


method.
a. append()
b. extend()
c. copy()
d. Both (a) and (b)

19CSC203A Page 2 of 3
Effective from: 09.11.20’

2 a. Develop a recursive function to compute the factorial of a 2 2,3


number.
b. Develop an iterative(non-recursive) function to compute the 3 2,3
factorial of a number.
3 a. Develop a function gcd(m,n) to return the GCD(Greatest 5 2,3
Common Divisor) of two numbers m and n, m>=1, n>=1. Trace
the computation of the call gcd(8,4).

4 a. Develop an iterative(non-recursive) function to perform binary 3 2,3


search. Test with input list of size equal to 16 and mention the
maximum number of comparisons required with justification.

b. Develop a function to compute the Disk Usage of a file or folder, 2 2,3


given the path to the file or folder as a parameter to the
function. You may use pseudo code. Assume a function size (f),
where f is a file or a folder. Explain how the function works with
sample input.
5 a. A sparse matrix contains most of its elements equal to 0. 5 5
Addition of two matrices of size m by n requires memory space
of 2 ∗ 𝑚 ∗ 𝑛 cells and 𝑚 ∗ 𝑛 addition operations. However, most
of the elements are equal to 0 in a sparse matrix, therefore,
memory as well as CPU time is wasted. Develop a Python
program for sparse matrix addition using appropriate data types
or data structures to store in memory only non-zero elements
and also reduce CPU time, with justification.
Sample Input:
A= 001 B= 100
100 000
010 010
Output:
101
100
020

CO (ILO) – Course Outcomes: -

1. Describe Linear and Non- Linear data structures such as Stacks, Queues, Linked Lists
and Trees
2. Explain the approaches used to implement the data structures
3. Discuss the working of standard data access and manipulation algorithms
4. Implement Stacks, Queues, Linked Lists and Trees
5. Recommend a suitable data structure and algorithm for modelling a given scenario
6. Develop computer programs using data structures to solve moderately complex
problems

19CSC203A Page 3 of 3

You might also like