Computer Science EngineeringEasy
Which data structure follows the Last-In-First-Out principle?
- A. Queue
- B. Stack
- C. Min-heap
- D. Linked list
Correct answer: B. Stack
A stack removes the most recently inserted element first.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- The height (in edges) of a complete binary tree having n nodes is
- The time needed to build a binary heap from n arbitrary elements using bottom-up heapify is
- The maximum number of nodes in a binary tree of height h (root at height 0) is
- The recurrence T(n) = 2T(n/2) + n log n solves to
- Consider int f(int n){ if(n<=1) return 1; return f(n-1)+f(n-2); }. What does f(6) return?
- Quicksort that always picks the first element as pivot runs in what time on an already sorted array?