Skip to content
VUBuddy

CS301 Midterm Solved Subjective with References by Students

Data Structures PDF 78 KBUpdated 23 Oct 2026
Midterm past paper CS301 Midterm Solved Subjective with References by Students PDF 78 KB
vubuddy.com
Type
Midterm past paper
Course
CS301 Data Structures
Size
PDF 78 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 78 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 7. Download the file for all 7 pages.

MIDTERM EXAMINATION · SEMESTER SPRING 2004 · CS301-DATA STRUCTURE · Instructions

  1. The duration of this examination is 60 Mins.
  2. This examination is closed book, closed notes, closed neighbors; any one found cheating will get no grade.
  3. Unless stated otherwise, all questions carry a single mark.
  4. You are allowed to use any development environment like Dev C++ etc.

Q1. Marks: 5

What is the value of the C/C++ expression: 6.2 + 5 / 3

6.2+5/3

  1. 2+1 (As 5 & 3 are integers so result will be in integer, fraction portion will be discard)

7.2

Q2. Marks: 5

What is the value of the postfix expression: 8 6 4 + 3 * + 5 +

Input · op1 · op2 · value · stack · Value of Postfix Expression = 43

Q3. Marks: 5

Write an equivalent postfix expression for the infix expression:

6 + ( 5 - 3 ) * 8

assuming standard precedence for order of operations.

Answer: 6 5 3 - 8 * +

Step No. Symbol Postfix Stack 6 5 3 - 6 5 3 - 6 5 3 - 8 6 5 3 - 8 * +

Q4. Marks: 10

A linked list node class is declared as follow: · class Node · public: · Node(const string& s, Node* ptr) · : info(s), next(ptr) · private: · string info; · Node* next;

Write a function that changes every ’t’ that occurs as the first letter of a word to a ’b’. No other letters should change. For example, ("tin", "tile", "ant", "saint", "tot") should be changed to ("bin", "bile", "ant", "saint", "bot")

void change(Node* list) · // post condition: all t’s that occur as first letters of a · // word in the list nodes are changed to b’s · Void change(Node * list) · temp = list; · While(temp !=NULL) · If (temp->info[0]==’t’) · Info[0]=’b’; · Temp=temp->next; · } //end of while

All CS301 files →
CS301 Data Structures All CS301 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.