- Type
- Midterm past paper
- Course
- CS301 Data Structures
- Size
- PDF 219 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 9. Download the file for all 9 pages.
- The duration of this examination is 60 Mins.
- This examination is closed book, closed notes, closed neighbors; any one found cheating will get no grade.
- Unless stated otherwise, all questions carry a single mark.
- Most, but not all, of the examination consists of multiple-choice questions. Choose only one choice as your
Answer: a. If you believe that two (or more) of the choices are the correct ones for a particular question, choose the best one. b. On the other hand, if you believe that all of the choices provided for a particular question are the wrong ones, select the one that appears to you as being the least wrong.
- You are allowed to use any development environment like Dev C++ etc.
Q1. Marks: 2
Which of the three member functions can change the PRIVATE member variables of the Foo
object that activates the function?
e. All three functions.
Q2. Marks: 2
What is the common pattern of writing class definitions?
Q3. Marks: 2
The Bag ADT is like the List ADT. The Bag ADT does not store items in any particular
order and it allows duplicates. Suppose that the Bag class is efficiently implemented with a fixed array with a capacity of 4000. Insert appends the new item at the end of the array. Choose the best description of b’s member variables size (count of items in the bag) and data (the array that holds the actual items) after we execute these statements:
What will be the values of b.size and b.data after the statements?
Q4. Marks: 2
The operation for adding an entry to a stack is traditionally called:
Q5. Marks: 5
What is written to the screen for the input “carpets”?
Q6. Marks: 2
In the linked list implementation of the stack class, where does the push member function
place the new entry on the linked list?
Q7. Marks: 2
One difference between a queue and a stack is:
a. Queues require dynamic memory, but stacks do not. b. Stacks require dynamic memory, but queues do not. c. Queues use two ends of the structure; stacks use only one. d. Stacks use two ends of the structure, queues use only one.
Related CS301 files
All CS301 files →- CS301 Midterm Past Paper Fall 2003 Session 3 Midterm PDF 203 KB
- CS301 Midterm Past Paper Fall 2003 Session 1 Midterm PDF 257 KB
- CS301 Midterm Past Paper Fall 2004 Set 2 Midterm PDF 26 KB
- CS301 Midterm Solved Quiz 1 and 2 Fall 2012 Midterm DOC 1.1 MB
- CS301 Highlighted Handouts by World of Education Highlighted PDF 13 MB
- CS301 Quiz 3 Lectures 26-33 Quiz PDF 6 MB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.