C The object alist is a list object Identify the sequence of

C++

The object alist is a list<int> object. Identify the sequence of operations that would store the following elements in the object alist:

8    6    2    5    7

alist.push_front(2);

alist.push_front(8);

alist.push_front(6);

alist.push_back(5);

alist.push_back(7);

alist.push_back(2)

alist.push_back(7);

alist.push_front(8);

alist.push_front(6);

alist.push_back(5);

alist.push_front(2)

alist.push_back(5);

alist.push_front(6);

alist.push_front(8);

alist.push_back(7);

alist.push_front(6);

alist.push_back(7);

alist.push_back(5);

alist.push_back(2);

alist.push_front(8);

None of the above.

A.

alist.push_front(2);

alist.push_front(8);

alist.push_front(6);

alist.push_back(5);

alist.push_back(7);

B.

alist.push_back(2)

alist.push_back(7);

alist.push_front(8);

alist.push_front(6);

alist.push_back(5);

C.

alist.push_front(2)

alist.push_back(5);

alist.push_front(6);

alist.push_front(8);

alist.push_back(7);

D.

alist.push_front(6);

alist.push_back(7);

alist.push_back(5);

alist.push_back(2);

alist.push_front(8);

E.

None of the above.

Solution

Option (C) is the right answer.I have given the explantion of each point as following :

1)alist.push_front(2) - 2

2)alist.push_back(5)-25

3)alist.push_front(6)-625

4)alist.push_front(8)-8625

5)alist.push_back(7)-86257 (ANSWER)

C++ The object alist is a list<int> object. Identify the sequence of operations that would store the following elements in the object alist: 8 6 2 5 7 ali
C++ The object alist is a list<int> object. Identify the sequence of operations that would store the following elements in the object alist: 8 6 2 5 7 ali

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site