Title | [Lab-8 Manual] CS-234-DSA |
---|---|
Author | Haider Ali |
Course | Data Structures and Algorithms |
Institution | GIFT University |
Pages | 6 |
File Size | 87.3 KB |
File Type | |
Total Downloads | 58 |
Total Views | 137 |
this is s dsa lab manual exam for students...
Data Structures and Algorithms CS-233 Lab number: 08 Lab title: Queue
Name: TALHA MANZOOR Roll number: 17139015
In-lab (10)
Viva(5)
Report(5)
Total (20)
Lab-8 Manual 2019
Queue Introduction To be able to implement and learn about queues.
Learning Outcomes In this lab we have learned about queues. Basically what are queues. They use two functions of enque and deque .They work on basis of FIFO(first in first out).
POST LAB 1. Convert the implemented queue in a circular queue. #include #include using namespace std; #define MAX 5 int queue_array[MAX]; int rear = -1; int front = -1; bool isFull(){ //if (rear == MAX - 1){ // return
v1.0 true;
//} Page 1
Lab-8 Manual 2019 if ((front == 0 && rear == MAX-1) || (front == rear + 1)){ return true;} else return false;} bool isEmpty(){ if (front == - 1){//|| front > rear){ return true;} else return false;} void enque(int data){ if (isFull()){ cout...