---
title: "Data structure and basic operations"
subject: "Data Structure and Algorithm"
chapter: 1
key: "semester_4/data_structure_and_algorithm:data-structure-basic-operations"
source: https://www.bctengineer.com/q/semester_4/data_structure_and_algorithm/data-structure-basic-operations
site: BCT Engineering
---

# Data structure and basic operations

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

- Asked in: 2072 Asoj, 4 marks
- Video: [Data structure operations | tutorial | in hindi part2](https://www.youtube.com/watch?v=Ap_pj701fOo) — CS Engineering Gyan
- 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-basic-operations
- Whole chapter: https://www.bctengineer.com/md/semester_4/data_structure_and_algorithm/chapter-1

## Question

Define a data structure. Explain the basic data structure operations.

## Short answer

A data structure organizes and stores data for efficient operations. Basic operations include traversal (visiting every element), search, insertion, deletion, sorting, merging, and updating.

## 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.

#### Basic data structure operations

| Operation | Meaning |
|---|---|
| Traversing | Visit every element exactly once to process it (e.g., print all items) |
| Searching | Find the location of an element with a given value or key |
| Insertion | Add a new element to the structure |
| Deletion | Remove an existing element |
| Sorting | Arrange elements in ascending or descending order |
| Merging | Combine two sorted structures into one sorted structure |
| Updating | Change the value of an existing element |

Example for an array `A = {10, 20, 30}`: traversing prints 10, 20, 30; searching for 20 returns index 1; inserting 15 at index 1 gives `{10, 15, 20, 30}`; deleting 30 gives `{10, 15, 20}`. Stack and queue add their own operations (push/pop, enqueue/dequeue).

## Check yourself

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

1. What does the traversing operation do?
   A. Finds the location of a given key
   B. Visits every element exactly once to process it
   C. Arranges elements in order
   D. Combines two structures
   Answer: B. Traversing means visiting each element once, for example to print all items. (Key point: Traversing)

2. Merging combines:
   A. Two sorted structures into one sorted structure
   B. Two elements into a single value
   C. One structure into two halves
   D. Unsorted data into a stack
   Answer: A. Merging produces one sorted structure out of two sorted ones. (Key point: Merging)

3. For A = {10, 20, 30}, inserting 15 at index 1 gives:
   A. {10, 15, 20, 30}
   B. {15, 10, 20, 30}
   C. {10, 20, 15, 30}
   D. {10, 15, 30}
   Answer: A. Elements from index 1 shift right and 15 is placed at index 1. (Key point: Insertion example)

4. In A = {10, 20, 30}, searching for 20 returns:
   A. Index 0
   B. Index 2
   C. Value 1
   D. Index 1
   Answer: D. Searching returns the location of the element; 20 is at index 1. (Key point: Searching example)

## Related in Data Structure and Algorithm

- [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
- [Linked list and its basic operations](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Alinked-list-and-operations) — Data Structure and Algorithm, chapter 4
- [Stack definition and basic operations](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Astack-operations-algorithms) — Data Structure and Algorithm, chapter 2
- [Define data structure and its importance](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Adata-structure-importance) — Data Structure and Algorithm, chapter 1
- [Primitive vs non-primitive data structure](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aprimitive-vs-nonprimitive) — Data Structure and Algorithm, chapter 1
- [Data structure; primitive vs non-primitive](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Adefine-ds-primitive-nonprimitive) — Data Structure and Algorithm, chapter 1

## Related in other subjects

- [Basic lathe operations](https://www.bctengineer.com/question.md?key=semester_2%2Fworkshop_technology%3Alathe-operations-explained) — Workshop Technology, chapter 6
- [Basic forging operations](https://www.bctengineer.com/question.md?key=semester_2%2Fworkshop_technology%3Aforging-operations-explained) — Workshop Technology, chapter 9
- [OLAP vs OLTP; data cube, operations](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aolap-oltp-data-cube-fact-dimension) — Data Mining, chapter 2
- [Basic structure of power system](https://www.bctengineer.com/question.md?key=semester_4%2Fpower_system_analysis_i%3Abasic-structure-power-system) — Power System Analysis I, chapter 1
