Can a stack be used to implement a queue data structure?

a. Yes.
b. Yes, if the stack is implemented using a double linked list.
c. No.
d. Yes, if the stack has an array.


a. Yes. A stack can implement a queue; the stack is "flipped" during operation.

Computer Science & Information Technology

You might also like to view...

What is the value of i after the following statements?

``` i = 2; i += 25; ``` a) 25 b) 27 c) 50 d) 52

Computer Science & Information Technology

Electronic paper (e-paper) requires less energy but is limited to one color

Indicate whether the statement is true or false

Computer Science & Information Technology

During a presentation you may find it helpful to add notes or drawings called ________ to some of your slides

Fill in the blank(s) with correct word

Computer Science & Information Technology

The following lines of code are supposed to create a DateTime variable and increment its hour value by two. Find the error(s) in the code.

DateTime dtmNow = DateTime.Now; dtmNow.AddHours( 2 );

Computer Science & Information Technology