Skip to main content

5 docs tagged with "linear-data-structures"

View all tags

Array

An array is a basic data structure used in programming to store a collection of elements, all of the same data type. These elements are stored in contiguous memory locations, which allows for efficient indexing and iteration. Arrays are widely used due to their simplicity and performance benefits.

Linear data structures

Linear Data Structures are those where data elements are arranged sequentially, with each element connected to the next and previous one (except for the first and last). This arrangement forms a linear sequence, making it easy to traverse the data in a single run.

Linked List

A linked list is a fundamental data structure that represents a sequence of elements. Each element, known as a node, contains:

Queue

A queue is a fundamental linear data structure in computer science that follows the First-In-First-Out (FIFO) principle. Just like a real-world queue (e.g., people lining up at a ticket counter), the first element added to the queue will be the first one to be removed.

Stack

A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. Imagine a stack of plates: the last plate placed on top is the first one to be taken off. In a stack, all insertions and deletions occur at one end, called the "top" of the stack.