โ† All AMCAT Flashcard Decks

Basic Data Structures Flashcards

7 cards from real AMCAT practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Basic Data Structures flashcards as text
  1. Which operation is used to remove an element from the front of a queue?

    Answer: Dequeue

    Dequeue (also called dequeue or poll) removes and returns the front element of a queue.

  2. A stack implemented using an array of size N can hold at most how many elements before overflow occurs?

    Answer: N

    An array-based stack of size N can hold exactly N elements before a stack overflow condition.

  3. What does the 'peek' (or 'top') operation on a stack return?

    Answer: Returns the top element without removing it

    Peek inspects the top element of the stack without modifying the stack.

  4. Which abstract data type is most appropriate for implementing a print spooler?

    Answer: Queue

    A print spooler processes jobs in the order they arrive (FIFO), making a queue the natural choice.

  5. In a deque (double-ended queue), insertions and deletions can occur at:

    Answer: Both front and rear

    A deque allows insertions and deletions at both the front and rear ends.

  6. When evaluating a postfix expression using a stack, what happens when an operand is encountered?

    Answer: It is pushed onto the stack

    In postfix evaluation, operands are pushed onto the stack; operators pop operands and push results.

  7. Which of the following queue variants gives highest-priority elements access before lower-priority ones regardless of arrival order?

    Answer: Priority Queue

    A priority queue dequeues elements based on assigned priority, not insertion order.