PadhaikoAll subjects

Past exam question: 2066 Bhadra (Regular / Back), Q1(a)

Data Structure and Algorithms · 5 marks

Open in the Padhaiko app

Topic: Introduction

Question

Why data structures are needed? Write any data structure as ADT

Solution

Need for Data Structures:

  1. Efficiency: Enables fast searching, sorting, insertion, and deletion on large datasets (e.g., vs. ).
  2. Memory Organization: Structures data logically (hierarchies, networks, ordered lists) to minimize memory waste and disk I/O.
  3. Abstraction & Reusability: Separates logical behavior from physical storage so modules remain maintainable.

Stack as an Abstract Data Type (ADT):

Answer:

Data structures are needed for algorithmic speed, optimal memory use, and clean problem modeling. The Stack ADT defines a LIFO collection with createStack, isEmpty, push, pop, and peek independent of array or linked implementation.

All past exam questions for Data Structure and Algorithms