PHYS 130 Lecture 14: MATH 126 Notes - gytqmoortwfdaee

76 views2 pages
11 Apr 2021
Department
Course
Professor

Document Summary

In the given program segment, first statement linkedqueuetype queue; declares queue to be a linked queue which is a collection of the elements of the type int. The next statement queue. addqueue(10); inserts the element at the rear i. e. last position in the queue. Here, an integer 10 is added to the end of the queue which is the only element till this point of program execution. Here, an integer 20 is added to the last position of the queue. The next statement cout << queue. front() << endl; displays the front element i. e. the first element of the queue which is the integer 10 and takes the cursor to the next line. The next statement queue. deletequeue(); deletes the front element from the queue i. e. the integer 10 is deleted from the queue. Here, an integer 2 * 20 = 40 is added to the last position of the queue.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related textbook solutions

Related Documents