You are on page 1of 2

Ministry for Higher Education Academic Year: 2020/2021

Modern Academy for Computer Term: 1st


Science and Management Technology Code: C201
Department: Computer Science Aids:
Program: Computer Science Total Marks: (20)
Subject: Data Structures
Examiner: Dr Mohamed Elgamml Time: 60 min
Number of Questions: (3) Questions for Midterm Exam. Number of Pages: (2)

Student Name: Student Id:

1- using the following code write a function to insert a new node in a specific position in the
LinkedList.

class Node
{
    public:
    int data;
    Node *next;
};

Solution:
2- Convert the following statement to Postfix then Show the algorithm in action to evaluate it using
Stack:

6-(3*5/4)+2*(9+3)

3- Using the following code write a function called enqueue to add an element to the queue:
int q[50];
int front = -1;
int rear = -1;
int number = 0;
Solution:

You might also like