0% found this document useful (0 votes)
91 views5 pages

Quiz 2 - Unit 3 - Attempt Review

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 5

10/7/21, 10:53 AM Quiz 2: Unit 3: Attempt review

Dashboard / My courses /
CMPS2131-LFL / 21 September - 27 September /
Quiz 2: Unit 3

Started on Thursday, 23 September 2021, 11:30 AM


State Finished
Completed on Thursday, 23 September 2021, 11:52 AM
Time taken 22 mins 18 secs
Grade 12.00 out of 12.00 (100%)

Question 1

Correct

Mark 1.00 out of 1.00

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

Mark 1.00 out of 1.00

A stack is referred to as a last-in,first-out(LIFO)data structure.


 

 
 

Select one:
True 

False

A stack is referred to as a last-in, first-out (LIFO) data structure.

The correct answer is 'True'.

Question 3

Correct

Mark 1.00 out of 1.00

The primary member functions used to manipulate a stack are: 


 

a. push and pop 

b. isEmpty() and isFull()

c. traverse and display

Your answer is correct.

The correct answer is: 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

Mark 1.00 out of 1.00

Stacks support recursive function calls in the same manner as conventional non-recursive calls.

 
 

Select one:
True 

False

The correct answer is 'True'.

Question 5

Correct

Mark 1.00 out of 1.00

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 

Your answer is correct.


"the last node inserted is the first node removed"

The correct answer is: 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

Mark 6.00 out of 6.00

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.

Your answer is correct.

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

Correct Quick Links


Mark 1.00 out of 1.00
About UB

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

Answer: stack overflow UB Student Portal 

UB ACM Student Chapter

The correct answer is: stack overflow Follow Us



◄ STACK METHODS- JAMBOARD LINK

Jump to... Contact


https://doit.ub.edu.bz/mod/quiz/review.php?attempt=30427&cmid=9106 4/5
10/7/21, 10:53 AM Quiz 2: Unit 3: Attempt review

Hummingbird Avenue, City of Belmopan QUEUES IN DATA STRUCTURES ►

 Phone: (501) 822-1000/ 822-3680

Copyright © 2020 - Developed by UB MPIT-IT. Powered by Moodle

Data retention summary


Department of Mathematics, Physics, and Information Technology (MPIT) - Faculty of Science and Technology - University of Belize

https://doit.ub.edu.bz/mod/quiz/review.php?attempt=30427&cmid=9106 5/5

You might also like