Draw an example using the five integers (12, 23, 1, 45, 9) of how a stack could be used to reverse the order (9, 45, 1, 23, 12) of these elements.

What will be an ideal response?


The five values would be pushed onto the stack in order, yielding (with the top of the stack on the left):
9 45 1 23 12
Then popping each value produces them in the reverse order to which they were first encountered.

Computer Science & Information Technology

You might also like to view...

In a Calc sheet, rows are numbered sequentially

Indicate whether the statement is true or false

Computer Science & Information Technology

When a primary key is made up of more than one field, it is known as what type of key?

A) Compound B) Foreign C) Primary D) Composite

Computer Science & Information Technology

In Outline view, slides in the left hand pane are displayed as thumbnails

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following protocols is used to validate whether trust is in place and accurate by returning responses of either "good", "unknown", or "revoked"?

A. CRL B. PKI C. OCSP D. RA

Computer Science & Information Technology