CPSA-FL practice question 8 of 10
Which of the following statements are correct? (Choose two.)
Full set: 43 questionsA stack is a fundamental abstract data type that operates on the Last-In, First-Out (LIFO) principle. The push operation is the standard method for adding a new element to the top of the stack. Because of its LIFO nature, operations such as adding (push), removing (pop), or viewing (peek) are restricted to the most recently added element, which is at the top. Consequently, a stack typically provides direct access to only one element at a time—the top one. To access deeper elements, the elements above them must be removed first.
B. A stack (LIFO) and a queue (FIFO) are distinct data structures with opposite principles of element access and removal.
C. The FIFO (First-In, First-Out) principle describes the behavior of a queue, not a stack, which is LIFO (Last-In, First-Out).
1. International Software Architecture Qualification Board (iSAQB). (2023). Curriculum for Certified Professional for Software Architecture - Foundation Level (CPSA-F)
Version 2.2EN. Section 2.3.2
"Data Structures
" describes a stack as a data structure organized according to the LIFO principle.
2. Cormen
T. H.
Leiserson
C. E.
Rivest
R. L.
& Stein
C. (2009). Introduction to Algorithms (3rd ed.). MIT Press. In Chapter 10
Section 10.1
"Stacks and queues
" a stack is defined as implementing a last-in
first-out (LIFO) policy. The PUSH operation is described as inserting an element onto the stack
and access is limited to the element at the "top."
3. Demaine
E. (2011). 6.006 Introduction to Algorithms
Fall 2011. Massachusetts Institute of Technology: MIT OpenCourseWare. Lecture 3
"Stacks
Queues
Linked Lists
" defines a stack with push(x) and pop() operations acting on the top of the stack
enforcing LIFO behavior. It explicitly contrasts this with the FIFO behavior of a queue.
Keep practicing
Take the free CPSA-FL practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CPSA-FL practice questions
- Question 1Which two of the following statements about quality characteristics are most accurate? (C…
- Question 2Which of the following principles apply to testing? (Choose two.)
- Question 3For which quality characteristics is the software architect responsible? Please name the …
- Question 4In a customer project the architecture shall be based on components. The requirements hav…
