Professional Documents
Culture Documents
DSA MidTerm Exam 20192020 Sample001
DSA MidTerm Exam 20192020 Sample001
Q1. 10 For stack of characters, define its data type by using the array. Write C++ functions to:
a) Add a new element to the top of the stack.
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
Page 1 of
SAMPLE0
Data Structures and Algorithms – Midterm Examination 15 March 2020
University of Science & Technology Level : 2nd Level IT/CN
Ibb Branch Semester : 2nd 2019/2020
Faculty of Computer Science & Duration : 1 Hour
IT IT and CN Programs Lecturer : Dr. Redhwan Q. Shaddad
Q2. 10 A C++ program defines a record of student (studentType) which has the following
members:
I. name : name of student.
III. average: grade of student.
II. id : identity number of student.
IV. gpa : grade point average of student.
Write C++ code to define:
a) studentType record.
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………
Good Luck
Page 2 of
SAMPLE0