1. >Programming and Data Structures
Found 5  QuestionsSET DEFAULT
Selected Filters
    Programming and Data Structures Stacks
Exams
Subjects
Topics

List of top Programming and Data Structures Questions on Stacks

Consider the following C code:

int main() {
    sum = 0;
    for (n = 1; n < 3; n++) {
        n++;
        sum += g(f(n));
    }
    printf("%d", sum);
}

int g(n) {
    return 10 + n;
}

int f(n) {
    return g(2 * n);
}
  

What is the output?

  • GATE CS - 2025
  • GATE CS
  • Programming and Data Structures
  • Stacks
It is taken that enteries that are made in stack are considered "ordered". What does this imply?
  • CUET (UG) - 2023
  • CUET (UG)
  • Programming and Data Structures
  • Stacks
which one of the following is not related with the stack ?
  • CUET (UG) - 2023
  • CUET (UG)
  • Programming and Data Structures
  • Stacks
Which out of the following is not the application of stacks?
  • CUET (UG) - 2023
  • CUET (UG)
  • Programming and Data Structures
  • Stacks
Consider the following sequence of operations on an empty stack and an empty queue.
Stack:
push(54); push(52); pop(); push(55); push(62); s = pop();
Queue:
enqueue(21); enqueue(24); dequeue(); enqueue(28); enqueue(32); q = dequeue();
The value of \( s + q \) is \(\underline{\hspace{2cm}}\).
  • GATE CS - 2021
  • GATE CS
  • Programming and Data Structures
  • Stacks