preview

Unit 1 M180 Assignment 1

Satisfactory Essays
Open Document

Name: Aws Yousif Alsewaidi Student ID: 140277 Subject: M180 Assignment Question 1 A. A stack uses the principle of Last In First Out (LIFO) to insert and remove objects. The last object inserted in the stack is the first object to be removed. A queue uses the principle of First In First Out (FIFO) to insert and remove objects. The first object inserted in the queue is the first object to be removed. B. A stack has two major operations for accessing data, pop and push. A push operation adds an object at the top of the stack and a pop operation removes the object at the top of the stack. A queue has two major operations dequeue and enqueue. An enqueue operations adds an object at the back of the queue while a dequeue operation

Get Access