After performing these set of operations, what does the final list look contain? InsertFront(11);
InsertFront(22);
InsertRear(33);
DeleteFront();
InsertRear(44)
InsertRear(11);
DeleteRear();
InsertRear(55);
display();
Answers
Answered by
0
After performing these set of operations, the final list look contains:(11,33,44,55)
- InsertFront adds a number in front of the list and InsertRear adds a number at the end of the list.
- DeleteFront deletes a number in front of the list and DeleteRear deletes a number at the end of the list.
- According to the sequence of the function and resulting dequeue are as follows :
- InsertFront(11); ⇒ 11
- InsertFront(22); ⇒ 22,11
- InsertRear(33); ⇒ 22,11,33
- DeleteFront(); ⇒ 11,33
- InsertRear(44); ⇒ 11,33,44
- InsertRear(11); ⇒ 11,33,44,11
- DeleteRear(); ⇒ 11,33,44
- InsertRear(55); ⇒ 11,33,44,55
- display(); ⇒ 11,33,44,55
#SPJ3
Similar questions