- Type
- Midterm past paper
- Course
- CS301 Data Structures
- Size
- PDF 257 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 10. Download the file for all 10 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
what notation does the body of Func use to assign the value 3 to n?
It can’t be done–n is private.
Q2. Marks: 2
Suppose that the class declaration of SomeClass includes the following function prototype.
bool LessThan( SomeClass anotherObject );
Which of the following tests in the client code correctly compares two class objects alpha and beta?
Q3. Marks: 2
When should you use a const reference parameter?
(a)
Whenever the data type might be many bytes.
(b)
Whenever the data type might be many bytes, the function changes the parameter within its body, and you do NOT want these changes to alter the actual argument.
(c)
Whenever the data type might be many bytes, the function changes the parameter within its body, and you DO want these changes to alter the actual argument.
(d)
Whenever the data type might be many bytes, and the function does not change the
parameter within its body.
Q4. 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?
(a)
Q5. Marks: 2
The operation for removing an entry from a stack is traditionally called:
Q6. Marks: 2
Which of the following stack operations could result in stack underflow?
Q7. Marks: 5
Related CS301 files
All CS301 files →- CS301 Midterm Past Paper Fall 2003 Session 2 Midterm PDF 219 KB
- CS301 Midterm Past Paper Fall 2004 Midterm PDF 39 KB
- CS301 Midterm Past Paper Fall 2004 Set 2 Midterm PDF 26 KB
- CS301 Midterm Past Paper 2010 Midterm PDF 91 KB
- CS301 Highlighted Handouts by Mickey Ch Highlighted PDF 12 MB
- CS301 Slides Lectures 1-45 Quiz RAR 1.4 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.