Answer the following statements true (T) or false (F)
1. Placing data on a stack is called popping the stack.
2. Removing data from a stack is called popping the stack.
3. There is no need for error checking when popping a stack.
4. There is no need for error checking when pushing a stack.
5. Data is inserted into a queue at the back
1. False
The correct term is pushing the item onto the stack.
2. True
Insertion is pushing, removal is popping. Some stacks use void pop operations that merely discards the data removed from the top. Such stacks provide a function to examine the top of the stack. Other stacks remove and return the data on the stack top.
3. False
It is an error to attempt to remove data from an empty stack. Such an error is called a stack underflow.
4. False
It is an error to attempt to insert data into a stack where no storage space remains. Such an error is a stack overflow.
5. True
Just like the lunch line, data is “added” at the back of the queue. Data is serviced at the front, and then removed once service is complete.
You might also like to view...
A way to develop a program before actually writing the code in a specific programming language is to use a general form, written in natural English, called __________.
Fill in the blank(s) with correct word
What is the correct declaration statement for an array of 100 integers?
A. dimension int [100]; B. int numbers[99]; C. dim numbers[100]; D. int numbers[100];
To improve readability and maintainability, you should declare _________ instead of using literal values such as 3.14159.
a. variables b. methods c. constants d. classes
Describe the KDE Panel.
What will be an ideal response?