Quiz 2 - Unit 3 - Attempt Review
Quiz 2 - Unit 3 - Attempt Review
Quiz 2 - Unit 3 - Attempt Review
Dashboard / My courses /
CMPS2131-LFL / 21 September - 27 September /
Quiz 2: Unit 3
Question 1
Correct
A stack data structure allows nodes to be added to and removed from the stack only at the bottom.
Select one:
True
False
A stack data structure allows nodes to be added to and removed from the stack only at the top.
The correct answer is 'False'.
https://doit.ub.edu.bz/mod/quiz/review.php?attempt=30427&cmid=9106 1/5
10/7/21, 10:53 AM Quiz 2: Unit 3: Attempt review
Question 2
Correct
Select one:
True
False
Question 3
Correct
a. push and pop
https://doit.ub.edu.bz/mod/quiz/review.php?attempt=30427&cmid=9106 2/5
10/7/21, 10:53 AM Quiz 2: Unit 3: Attempt review
Question 4
Correct
Stacks support recursive function calls in the same manner as conventional non-recursive calls.
Select one:
True
False
Question 5
Correct
A stack is referred to as a(n)_____________ data structure, because the last node inserted is the first node removed
a. ADT
b. FIFO
c. LIFO
https://doit.ub.edu.bz/mod/quiz/review.php?attempt=30427&cmid=9106 3/5
10/7/21, 10:53 AM Quiz 2: Unit 3: Attempt review
Question 6
Correct
The following are stack functions. Match the function definition to its corresponding function name.
isEmpty()
It determines whether the stack is empty or not.
When we delete an element from the stack, the operation is known as a pop. If the stack is empty means that no pop()
element exists in the stack, this state is known as an underflow state.
When we insert an element in a stack then the operation is known as a push. If the stack is full then the overflow push()
condition occurs.
isFull()
It determines whether the stack is full or not.
display()
It prints all the elements available in the stack.
count()
It returns the total number of elements available in a stack.
The correct answer is: It determines whether the stack is empty or not. → isEmpty(), When we delete an element from the stack,
the operation is known as a pop. If the stack is empty means that no element exists in the stack, this state is known as an
underflow state. → pop(), When we insert an element in a stack then the operation is known as a push. If the stack is full then the
overflow condition occurs. → push(), It determines whether the stack is full or not. → isFull(), It prints all the elements available in
The
theInformation Technology
stack. → display(), Program
It returns theprepares students
total number for work,
of elements further study
available and research
in a stack. in the Information Technology field locally,
→ count()
regionally and globally. The program provides knowledge, skills and the discipline that will enable graduates to make a positive impact
on the working environment and be able to function as entrepreneurs in the community.
Question 7
About FST
An undesirable condition involving the use more memory space than is available in a computer program is referred to as:
Faculty and Staff
UB Virtual Tour
◄ STACK METHODS- JAMBOARD LINK
https://doit.ub.edu.bz/mod/quiz/review.php?attempt=30427&cmid=9106 5/5