This presentation covers data structures including arrays, linked lists, and stacks. It discusses array types (one and multi-dimensional), linked list types (singly, doubly, circular), and common operations for each. Stack operations like push, pop, peek and applications for infix, prefix, postfix notation conversion are also explained with examples. Code snippets are provided for array traversal, insertion, deletion as well as linked list creation, insertion, deletion and traversal.
Data Structure Introduction
Data Structure Definition
Data Structure Types
Data Structure Characteristics
Need for Data Structure
Stack Definition
Stack Representation
Stack Operations
Stack Algorithm
Program for Stack in C++
Linked List Definition
Linked List Representation
Linked List Operations
Linked List Algorithm
Program for Linked List in C++
Linked List Defination
Linked List Representation
Linked List Operations
Linked List Algorithm
Program for Linked List in C++
Data Structure Introduction
Data Structure Definition
Data Structure Types
Data Structure Characteristics
Need for Data Structure
Stack Definition
Stack Representation
Stack Operations
Stack Algorithm
Program for Stack in C++
Linked List Definition
Linked List Representation
Linked List Operations
Linked List Algorithm
Program for Linked List in C++
Linked List Defination
Linked List Representation
Linked List Operations
Linked List Algorithm
Program for Linked List in C++
data structure programing language in c.pptLavkushGupta12
A data structure is a specialized format for organizing, processing, retrieving and storing data. There are several basic and advanced types of data structures, all designed to arrange data to suit a specific purpose
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
2. Topics We Will Cover in This Slide
1. Arrays
2. Types of Arrays
3. Operations in Arrays
4. Array Of Pointers
5. Concepts Of an Array
6. Linked List
7. Types Of Linked List
8. Operations in Linked List
9. Stacks
10.Stacks Operations
11.Infix Prefix Postfix Conversion (Stack)
3. Arrays
➢ An Array is a linear data structure which is a finite collection of similar data
items stored in successive or consecutive memory locations.
➢ An array may contain all integer or character elements, but not both.
➢ Each array can be accessed by using array index and it is must be positive
integer value enclosed in square braces. Ex: int arr [5]
➢ Array starts from the numeric value 0 and ends at 1 less than of the index
array value
4. Types of Array
1. One Dimensional Array
2. Two Dimensional or Multi Dimensional Array
5. One Dimensional Array
One dimensional array is also called as linear array. It stores the data elements
in single row or columns.
Syntax: <data type> <array name> [Size] = {Values}
7. Two Dimensional Array
➢ A two dimensional array is a collection of elements placed in rows and
columns.
➢ Two subscripts are used to reference an elements in an array of which one
specifies the number of rows and the other specifies number of columns.
Syntax: <data type> <array name> [row size] [column size] = {Values}
10. Insertion
1. Insertion is nothing but adding a new element in an array.
1. Here, through a loop, we will shift the numbers from a specific position,
one place to the right of their existing place.
12. Deletion
1. Deletion is nothing but deleting an element from the array.
1. Here, we will shift the numbers from a specific position from where the
number is to be deleted, one place to the left of their existing place.
14. Traversal
In traversing operation of an array, each element of an array is accessed
exactly for once for processing.
This is also called visiting of an array.
16. Reversing
This program reverses the array elements.
For example:
if 'A' is an array of integers with three elements such that
A[0] = 1, A[1] = 2, A[2] = 3 [1, 2, 3]
Then after reversing, the array will be
A[0] = 3, A[1] = 2, A[0] = 1 [3, 2, 1]
20. Searching
Searching is the process Of finding the location of an element With a given
element in a list.
Here, searching is start from 0 element And continue the process until the Given
specified number Is found or the end of the list is reached.
22. Merging
Merging means combining two sorted list into one sorted list.
This involves Two Steps:
➔ sorting the arrays that are to be merged.
➔ adding the sorted elements of both the arrays a2a new array in sorted order.
24. Array of Pointers
● An array of a pointer is nothing but a Collection of addresses.
● A pointer variable Always contains an addresses.
● The address present in an array of pointer can be address of isolated variables
or even the address of other variables.
● loginAn array of pointers widely used for storing several strings in the array.
● the rules that apply to an ordinary array also applied to an array of pointer as
well.
● the elements of an array of pointer are stored in the memory just like the
elements of any other kind of array.
25. Important concept of array
1. Array always fixed size of data elements (Declaration)
2. Array can be considered as a static data
3. Array elements are placed in sequential order thus
eliminating the gap in the memory allocation
4. The index value starts with 0
5. The data elements should be of same data type
6. Array can be used in search algorithms (Binary search)
7. Array can be used in sorting algorithms (Bubble sort)
8. An array can be declared, initialized and referred by
value.
26. Linked list
Linked list is a collection of elements called nodes.
Linked list is a linear Data Structure. Each node contains data part and link
part.
● the data contains elements and
● links contains address of other node.
Node
we can say links as an address
27. Linked List Representation
➔ Each node carries a data field and a link field called Next
➔ Each node is linked with its next node using next link.
➔ Last node carries a link as null to mark the end of the linked list.
28. Types of Linked List
1. Singly Linked List
2. Doubly Linked List
3. Circular Linked List
29. Singly Linked List
A single linked list is one in which all nodes are linked together in some sequential manner.
It contain nodes which have a data part as well as an address part i.e. next which points to
the next node in the sequence of nodes.
The operations in this linked list, we can perform are insertion, deletion and traversal.
30. Doubly Linked List
Doubly linked list is a variation of linked list in which navigation is possible in both
ways, either forward and backward easily as compared to single linked list.
In a doubly linked list, each node contains a data part and two addresses, one for
the previous note and one for the next node
The Operations in doubly linked list, that we can perform the are insertion deletion
and displaying the linked list
31. Circular Linked List
Circular Linked List is a variation of Linked List in which the first element point
to the last element and the last element points to the first element. Both singly
or doubly Linked List can be made into a circular linked list.
A circular Linked List is one which has no beginning or no ending. The Null
Pointer in the last node of a linked list is replaced with the address of its first.
Here, all nodes are connected to form a circle.
32. ➢ Singly Linked List As Circular Linked List
In singly linked list, the next pointer of the last node points to the first node.
➢ Doubly Linked List As Circular Linked List
In doubly linked list, the next pointer of the last node points to the first node and
the previous pointer of the first node points to the last node making the circular in
both directions.
38. Stacks
Stack is an abstract data type with a bounded(predefined) capacity. It is a simple
data structure that allows adding and removing elements in a particular order. Every
time an element is added, it goes on the top of the stack and the only element that
can be removed is the element that is at the top of the stack, just like a pile of
objects.
41. Algorithms for push()
push(int x)
{
if(top >= 10)
{
cout << "Stack Overflow n";
}
else
{
a[++top] = x;
cout << "Element Inserted n";
}
}
❖ Check if the stack is full or not.
❖ If the stack is full, then print error of overflow and exit the program.
❖ If the stack is not full, then increment the top and add the element.
42. Algorithms for pop()
int pop()
{
if(top < 0)
{
cout << "Stack Underflow n";
return 0;
}
else
{
int d = a[top--];
return d;
}
}
❖ Check if the stack is empty or not.
❖ If the stack is empty, then print error of underflow and exit the program.
❖ If the stack is not empty, then print the element at the top and decrement the top.
44. Algorithms for isEmpty()
void isEmpty()
{
if(top < 0)
{
cout << "Stack is empty n";
}
else
{
cout << "Stack is not empty n";
}
}
45. Algorithms for peek()
int peek()
{
return stack[top];
}
➢ It returns the top data element of the stack.
46. Infix Prefix Postfix Conversion (Stack)
Introduction
Operation:- A + B + C
Operand:- A, B, C, or 1, 2, 3
Operators:- +, -, *, /, etc.
47. Infix Notation
Infix is the day to day notation that we use of format A + B type.
The general form can be classified as (a op b) where a and b are operands(variables) and
op is Operator.
Examples:-
A + B
A * B + C / D
(A + B) * (C + D)
48. Prefix Notation
Postfix is notation that compiler uses/converts to while reading left to right and is of format AB+ type.
The general form can be classified as (ab op) where a and b are operands(variables) and op is Operator.
Example:-
AB+
AB*CD/+
* + AB + CD
49. Postfix Notation
Prefix is notation that compiler uses/converts to while reading right to left and is of format +AB
type.
The general form can be classified as (op ab) where a and b are operands(variables) and op is
Operator.
Examples:-
AB+
AB*CD/+
AB+CD+*
Of finding the location of an element With a given element in a list.
Here, searching is start from 0 element And continue the process until the Given specified number Is found or the end of the list is reached.
Merging means combining two sorted list into one sorted list.
This involves Two Steps:
sorting the arrays that are to be merged.
adding the sorted elements of both the arrays a2a new array in sorted order