0% found this document useful (0 votes)
50 views2 pages

1-Using The Following Code Write A Function To Insert A New Node in A Specific Position in The Linkedlist

The 3-sentence summary is: This document contains a 3-question midterm exam for a Data Structures course covering inserting a node into a linked list at a specific position, converting an infix expression to postfix notation and evaluating it using a stack, and writing a function to add an element to the rear of a queue using given queue variables and arrays. The exam is for Term 1 of the 2020/2021 academic year in the Computer Science program at the Modern Academy for Computer Science and Management Technology.

Uploaded by

mohamed elgamml
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

1-Using The Following Code Write A Function To Insert A New Node in A Specific Position in The Linkedlist

The 3-sentence summary is: This document contains a 3-question midterm exam for a Data Structures course covering inserting a node into a linked list at a specific position, converting an infix expression to postfix notation and evaluating it using a stack, and writing a function to add an element to the rear of a queue using given queue variables and arrays. The exam is for Term 1 of the 2020/2021 academic year in the Computer Science program at the Modern Academy for Computer Science and Management Technology.

Uploaded by

mohamed elgamml
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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