Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Data Structures and Algorithms Module 01 PART-01, Study notes of Data Structures and Algorithms

DATA STRUCTURES AND ALGORITHMS: Basic Terminologies,Elementary Data Organizations,Classifications of Data Structure.

Typology: Study notes

2022/2023

Available from 07/14/2023

nidhi-11
nidhi-11 🇮🇳

1 document

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
DATA STRUCTURE AND ALGORITHMS
Data Structure:
It refers to the way data is organized, stored, and manipulated in a computer's memory. It
defines the relationship between data elements, their operations, and the memory required to
store them.
CLASSIFICATION OF DATA STRUCTURE:
LINEAR DATA STRUCTURE:
Linear data structures are data structures in which data elements are organized sequentially,
one after another. These structures are called "linear" because the elements are arranged in a
linear manner, meaning they form a sequence.
Some commonly used linear data structures include arrays, linked lists, stacks, and queues.
Array:
An array is a fixed-size collection of elements of the same data type.
Elements in an array are stored in contiguous memory locations.
Elements can be accessed using an index, which represents their position in the array
(starting from 0).
Arrays provide efficient random access to elements but have a fixed size.
Linked List:
A linked list is a dynamic data structure where elements are stored in separate objects
called nodes.
Each node contains the data and a reference (or link) to the next node.
Nodes in a linked list can be scattered in memory, unlike arrays.
pf3

Partial preview of the text

Download Data Structures and Algorithms Module 01 PART-01 and more Study notes Data Structures and Algorithms in PDF only on Docsity!

DATA STRUCTURE AND ALGORITHMS

Data Structure: It refers to the way data is organized, stored, and manipulated in a computer's memory. It defines the relationship between data elements, their operations, and the memory required to store them. CLASSIFICATION OF DATA STRUCTURE: LINEAR DATA STRUCTURE: Linear data structures are data structures in which data elements are organized sequentially, one after another. These structures are called "linear" because the elements are arranged in a linear manner, meaning they form a sequence. Some commonly used linear data structures include arrays, linked lists, stacks, and queues. Array:

  • An array is a fixed-size collection of elements of the same data type.
  • Elements in an array are stored in contiguous memory locations.
  • Elements can be accessed using an index, which represents their position in the array (starting from 0).
  • Arrays provide efficient random access to elements but have a fixed size.
  • Linked List:
  • A linked list is a dynamic data structure where elements are stored in separate objects called nodes.
  • Each node contains the data and a reference (or link) to the next node.
  • Nodes in a linked list can be scattered in memory, unlike arrays.
  • Linked lists allow efficient insertion and deletion operations but have slower random access compared to arrays. Stack:
  • A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle.
  • Elements can be added or removed only from the top of the stack.Adding an element is called "push," and removing an element is called "pop."
  • Stacks are often used for implementing function calls, expression evaluation, and backtracking algorithms. Queue:
  • A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle.
  • Elements are added at one end (rear) and removed from the other end (front) of the queue.
  • Adding an element is called "enqueue," and removing an element is called "dequeue."
  • Queues are commonly used for scheduling processes, handling requests, and breadth- first search algorithms. NON-LINEAR DATA STRUCTURE: Non-linear data structures are data structures in which data elements are not organized sequentially like in linear data structures. Instead, they exhibit hierarchical or interconnected relationships among the elements. These structures allow more complex representations of data and are essential for solving problems that involve relationships between entities. Some commonly used non-linear data structures include trees and graphs. Tree:
  • A tree is a hierarchical data structure with a set of connected nodes.
  • It starts with a root node and branches out into child nodes, forming a tree-like structure.
  • Each node can have zero or more child nodes, except the leaf nodes that have no children.
  • Trees are used to represent hierarchical relationships, such as file systems, organizational structures, and binary search trees for efficient searching. Binary Tree:
  • A binary tree is a special type of tree in which each node can have at most two children: a left child and a right child.
  • Binary trees are widely used in various applications, including binary search trees, expression trees, and Huffman coding. Graph:
  • A graph is a collection of nodes (vertices) connected by edges.
  • The nodes can be interconnected in any arbitrary way, forming complex relationships.