DS Notes
DS Notes
4. These data types are also called Simple data types, as they contain
characters that can't be divided further
Arrays:
One-Dimensional Array: An Array with only one row of data elements is known as a One-
Dimensional Array. It is stored in ascending storage location.
Two-Dimensional Array: An Array consisting of multiple rows and columns of data elements is
called a Two-Dimensional Array. It is also known as a Matrix.
Multidimensional Array: We can define Multidimensional Array as an Array of Arrays.
Multidimensional Arrays are not bounded to two indices or two dimensions as they can include
as many indices are per the need.
Data Structures (3130702)
-We can store a list of data elements belonging to the same data type.
-Array acts as an auxiliary storage for other data structures.
-The array also helps store data elements of a binary tree of the fixed count.
-Array also acts as storage of matrices.
Linked Lists
- Singly Linked List: A Singly Linked List is the most common type of Linked List. Each
node has data and a pointer field containing an address to the next node.
- Doubly Linked List: A Doubly Linked List consists of an information field and two pointer
fields. The information field contains the data. The first pointer field contains an address
of the previous node, whereas another pointer field contains a reference to the next
node. Thus, we can go in both directions (backward as well as forward).
- Circular Linked List: The Circular Linked List is similar to the Singly Linked List. The only
key difference is that the last node contains the address of the first node, forming a
circular loop in the Circular Linked List.
- The Linked Lists help us implement stacks, queues, binary trees, and graphs of
predefined size.
- We can also implement Operating System's function for dynamic memory management.
- Linked Lists also allow polynomial implementation for mathematical operations.
- We can use Circular Linked List to implement Operating Systems or application functions
that Round Robin execution of tasks.
- Circular Linked List is also helpful in a Slide Show where a user requires to go back to the
first slide after the last slide is presented.
- Doubly Linked List is utilized to implement forward and backward buttons in a browser
to move forward and backward in the opened pages of a website.
Data Structures (3130702)
Stacks:
A Stack is a Linear Data Structure that follows the LIFO (Last In, First Out)
principle that allows operations like insertion and deletion from one end of
the Stack, i.e., Top. Stacks can be implemented with the help of contiguous
memory, an Array, and non-contiguous memory, a Linked List. Real-life
examples of Stacks are piles of books, a deck of cards, piles of money, and
many more.
Pop: Operation to remove or delete elements from the Stack is termed as Pop
Operation.
Data Structures (3130702)
Queues:
Data Structures (3130702)
Enqueue: The insertion or Addition of some data elements to the Queue is called Enqueue. The
element insertion is always done with the help of the rear pointer.
Dequeue: Deleting or removing data elements from the Queue is termed Dequeue. The
deletion of the element is always done with the help of the front pointer.