0% found this document useful (0 votes)
3 views2 pages

Understanding Data Structures Basics

Data Structures are specialized formats for organizing, retrieving, and storing data, enabling various data processing operations such as insertion, deletion, and searching. Key types include Linear Lists, Stacks, Queues, Arrays, Linked Lists, and Binary Trees, each with specific functionalities and principles like LIFO for stacks and FIFO for queues. Stacks use PUSH and POP for data management, while queues utilize INSERT and DELETE operations, with implementations varying between linear and circular queues.

Uploaded by

mmercieca07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Understanding Data Structures Basics

Data Structures are specialized formats for organizing, retrieving, and storing data, enabling various data processing operations such as insertion, deletion, and searching. Key types include Linear Lists, Stacks, Queues, Arrays, Linked Lists, and Binary Trees, each with specific functionalities and principles like LIFO for stacks and FIFO for queues. Stacks use PUSH and POP for data management, while queues utilize INSERT and DELETE operations, with implementations varying between linear and circular queues.

Uploaded by

mmercieca07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Module 8 – Data Structures

Data Structures are a specialised format for organising, retrieving and


storing data. They are used to perform DATA PROCESSING OPERATIONS.
These include:

1. Insert data
2. Delete data
3. Display data
4. Search data
5. Sort data
6. Traverse data
7. Edit data

Types of Data Structures:

1. Linear List (aka ArrayList)


2. Stack
3. Queue
4. Arrays (primitive Array(1-d, 2-d))
5. Linked List
6. Binary Tree

STACK

- Is a temporary memory store


- It works in the LIFO principle
- It uses a stack pointer to point to the last item entered on stack
- It uses the mnemonic PUSH & POP to insert data & delete
- Implements the PUSH & POP algorithm using an array

Uses of stack:

1. Calling of subroutines
2. RPN – Reverse Polish Notation
3. Interrupt handling
QUEUE

- Works on the FIFO principle


- It makes use of 2 pointers
o Stack pointer – points to the first item entered in queue
o Stop pointer – points to the last item entered on queue
- The term used to add an item on queue is INSERT
- The term used to remove an item on queue is DELETE
- Two different types of queues
o Linear queue
o Circular queue
- Implement the algorithms of INSERT & DELETE using an Array.

Insert Algorithm:

1. Linear Queue: start_ptr = 1

Stop_ptr = MAX

-Queue is full-

2. Circular queue: start_ptr + 1;

-Queue id full-

You might also like