---
title: "Define data structure; explain ADT"
subject: "Data Structure and Algorithm"
chapter: 1
key: "semester_4/data_structure_and_algorithm:data-structure-and-adt"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/data-structure-and-adt
site: BCT Engineering
---

# Define data structure; explain ADT

Data Structure and Algorithm · Chapter 1: Concept of data structure

- Asked in: 2068 Bhadra, 4 marks
- Video: [Abstract Data Types | DSA](https://www.youtube.com/watch?v=wy0TPi9M7VM) — Telusko
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/data-structure-and-adt
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-1

## Question

Define data structures. Explain ADT with suitable example.

## Short answer

A data structure is a way of organizing and storing data efficiently. An abstract data type (ADT) is a mathematical model defined by values and allowed operations, hiding implementation. For example, the STACK ADT specifies push, pop, and empty operations without revealing whether the stack uses an array or linked list.

## Answer

A **data structure** is a particular way of organising and storing data in the memory of a computer so that it can be accessed, searched and modified efficiently. It also includes the set of operations defined on the organised data. Examples: array, stack, queue, linked list, tree, graph.

#### Abstract data type (ADT)

An **abstract data type (ADT)** is a mathematical model of a data type that is defined by its **values** and the **operations** allowed on them, without saying how they are stored or coded. The user sees only *what* the type does; *how* it is done (array, linked list, etc.) stays hidden. In Tenenbaum's style an ADT has two parts: a **value definition** and an **operator definition**.

#### Example: STACK ADT

```text
/* Value definition: a sequence of elements of type eltype,
   insertion and deletion allowed only at one end (top) */
abstract typedef <<eltype>> STACK(eltype);

/* Operator definition */
abstract empty(s)  STACK(eltype) s;
   postcondition empty == (len(s) == 0);
abstract push(s, elt)  STACK(eltype) s; eltype elt;
   postcondition s == <elt> + s(before);
abstract eltype pop(s)  STACK(eltype) s;
   precondition  empty(s) == FALSE;
   postcondition pop == first(s(before));
                 s == sub(s(before), 1, len(s(before)) - 1);
```
A program uses `push`, `pop` and `empty` only; whether the stack is an array or a linked list is hidden.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. A data structure is:
   A. A hidden implementation with no operations
   B. A particular way of organising and storing data so it can be accessed and modified efficiently
   C. A mathematical model with no storage
   D. A language keyword
   Answer: B. It organises data in memory together with its operations. (Key point: Definition)

2. Which keyword gives the type and structure in an ADT value definition?
   A. abstract typedef
   B. precondition
   C. postcondition
   D. condition only
   Answer: A. abstract typedef defines the type; condition optionally restricts values. (Key point: ADT parts)

3. A program using the STACK ADT uses push, pop and empty. What is hidden?
   A. Whether push inserts at the top
   B. Whether the stack is an array or a linked list
   C. Whether pop needs a non-empty stack
   D. Whether the stack is LIFO
   Answer: B. Only the implementation is hidden, not the behaviour. (Key point: Stack ADT hidden)

4. pop(s) postcondition says pop == first(s(before)). This means pop:
   A. Returns the new top element
   B. Returns the stack length
   C. Returns the old top element
   D. Returns TRUE if empty
   Answer: C. The old first (top) element is returned and removed. (Key point: Pop behaviour)

## Related in Data Structure and Algorithm

- [ADT versus data structure](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aadt-vs-data-structure) — Data Structure and Algorithm, chapter 1
- [Types of data structures; ADT example](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Adata-structure-types-adt-example) — Data Structure and Algorithm, chapter 1
- [Data type and ADT definition](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Adata-type-and-adt) — Data Structure and Algorithm, chapter 1, asked 3×
- [Static and dynamic data structures; array list](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Astatic-dynamic-ds-array-list) — Data Structure and Algorithm, chapter 3
- [Data structure types and operations](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Adata-structure-types-operations) — Data Structure and Algorithm, chapter 1
- [Define ADT with example](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aadt-with-example) — Data Structure and Algorithm, chapter 1, asked 3×

## Related in other subjects

- [Project financing; structures; capital structure steps](https://www.bctengineer.com/question.md?key=semester_7%2Fproject_engineering%3Aproject-finance-define-structures-steps) — Project Engineering, chapter 6
- [Define structure; need of structures](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Adefine-structure-need) — Computer Programming, chapter 8, asked 2×
