SlideShare a Scribd company logo
1 of 43
18ECCP101L
MASSIVE OPEN ONLINE
COURSE(MOOCS) - 1
PLATFORM – Udemy
Done By – K.JASWANTH (RA2011004010013)
Course Details
◦ Course Platform – Udemy
◦ Course Title – Fundamental Data Structures & Algorithms Using C language
◦ Created By – Shibaji Paul
◦ Duration – 15h 41m
About this Course
Introduction
◦ This course will help the students ability to grasp the knowledge of data structures and
algorithm using the C programming language. Knowledge of Data Structures and Algorithms
are essential in developing better programming skills.
◦ This course is based on the standard curriculum of Universities across the globe for graduate
level engineering and computer application course.
◦ Apart from step by step development of concepts students will also learn how to write
algorithms and then how to write programs based on the algorithms in this course.
◦ Students who want to prepare themselves for interview of top companies like Google, Amazon
or Microsoft. Students who are looking forward to be an efficient programmer, who are having
data structures in their syllabus. Students who wants to have in dept knowledge about the
Stack, Queue and Linked List, Efficiency of Algorithm, Binary Tree, Heap
Course Overview
◦ Total 14 Sections
◦ Introduction to the course
◦ All about stack
◦ Parenthesis checking using stack
◦ Polish notation and Reverse Polish notation
◦ All about Queue
◦ Linked list
◦ Singly Linked list
◦ Doubly Linked list
◦ Circular Linked list
◦ Efficiency of Algorithm
◦ Binary search
◦ Recursion
◦ Binary Tree and Binary search tree
◦ Heap
Section - 1
Section - 2
Section - 3
Section - 4
Section - 5
Section - 6
Section - 7
Section - 8
Section - 9
Section - 10
Section - 11
Section - 12
Section - 13
Section - 14
Stack
◦ A stack is a linear data structure, collection of items of the same type.
◦ Stack follows the Last In First Out (LIFO) fashion wherein the last element entered
is the first one to be popped out.
◦ In stacks, the insertion and deletion of elements happen only at one endpoint of it.
◦ Operations performed on Stacks
The following are the basic operations served by the Stacks.
• Push: This function adds an element to the top of the Stack.
• Pop: This function removes the topmost element from the stack.
• IsEmpty: Checks whether the stack is empty.
• IsFull: Checks whether the stack is full.
• Top: Displays the topmost element of the stack.
Implementation of Stack
Polish Notation
◦ Polish notation is a notation form for expressing arithmetic, logic and algebraic
equations. Its most basic distinguishing feature is that operators are placed on the
left of their operands. If the operator has a defined fixed number of operands, the
syntax does not require brackets or parenthesis to lessen ambiguity.
◦ Polish notation is also known as prefix notation, prefix Polish notation, normal
Polish notation, Warsaw notation and Lukasiewicz notation.
◦ Example:
◦ Infix notation with parenthesis: (3 + 2) * (5 – 1)
◦ Polish notation: * + 3 2 – 5 1
Reverse notation
◦ Reverse Polish notation (RPN) is a method for conveying mathematical expressions without
the use of separators such as brackets and parentheses. In this notation, the operators follow
their operands, hence removing the need for brackets to define evaluation priority. The
operation is read from left to right but execution is done every time an operator is reached,
and always using the last two numbers as the operands. This notation is suited for computers
and calculators since there are fewer characters to track and fewer operations to execute.
◦ So in a computer using RPN, the evaluation of the expression 5 1 – 3 * is as follows:
1.Push 5 into the stack. This is the first value.
2.Push 1 into the stack. This is the second value and is on the position above the 5.
3.Apply the subtraction operation by taking two operands from the stack (1 and 5). The top
value (1) is subtracted from the value below it (5), and the result (4) is stored back to the
stack. 4 is now the only value in the stack and is in the bottom.
4.Push 3 into the stack. This value is in the position above 4 in the stack.
5.Apply the multiplication operation by taking the last two numbers off the stack and
multiplying them. The result is then placed back into the stack. After this operation, the stack
now only contains the number 12.
QUEUE
◦ A queue in C is basically a linear data structure to store and manipulate the data elements. It
follows the order of First In First Out (FIFO).
◦ In queues, the first element entered into the array is the first element to be removed from the
array.
◦ A queue is open at both ends. One end is provided for the insertion of data and the other end
for the deletion of data.
◦ A queue is open at both ends. One end is provided for the insertion of data and the other end
for the deletion of data.
◦ A queue can be implemented with any programming language such as C, Java, Python, etc.
Implementation of Queue
Linked List
◦ A linked list is a sequence of data structures, which are connected together via links. Linked List
is a sequence of links which contains items. Each link contains a connection to another link.
Linked list is the second most-used data structure after array.
◦ The size of the arrays is fixed: So we must know the upper limit on the number of elements in
advance. Also, generally, the allocated memory is equal to the upper limit irrespective of the
usage.
Implementation of linked list
Singly Linked list
◦ Singly linked list is the most common linked list among the others. The singly linked list can be
traversed only in one direction. It is a collection of ordered sets of elements. In singly linked list,
Each node has a data and a pointer to the next node.
◦ Syntax
struct node
{ int data;
struct node *next;
}
Double Linked List
◦ In the doubly linked list, we add a pointer to the previous node and also to the next node. The
Doubly linked list can be traversed in two directions such as forward and backward.
◦ Syntax
struct node
{ int data;
struct node *next_node;
struct node *previous_node;
}
Circular Linked List
◦ The circular linked list is a linked list where all nodes are connected to form a circle. In a
circular linked list, the first node and the last node are connected to each other which forms a
circle. There is no NULL at the end.Syntax
syntax:
class Node{
int value;
// Points to the next node.
Node next;
}
There are two types of circular linked list those are 1.circular singly
linked list
2.circular doubled linked list
◦ Circular singly linked list: In a circular Singly linked list, the last
node of the list contains a pointer to the first node of the list. We
traverse the circular singly linked list until we reach the same
node where we started. The circular singly linked list has no
beginning or end. No null value is present in the next part of any
of the nodes.
◦ Circular Doubly Linked List has properties of both doubly linked
list and circular linked list in which two consecutive elements are
linked or connected by the previous and next pointer and the last
node points to the first node by the next pointer and also the
first node points to the last node by the previous pointer.
Efficiency of Algorithm:
◦ In computer science, algorithmic efficiency is a property of an algorithm which relates to the
amount of computational resources used by the algorithm
◦ Efficiency of an algorithm is measured by assuming that all other factors, for example, processor
speed, are constant and have no effect on the implementation. A Posterior Analysis − This is an
empirical analysis of an algorithm. The selected algorithm is implemented using programming
language.
◦ One way to measure the efficiency of an algorithm is to count how many operations it needs in
order to find the answer across different input sizes.
Binary search algorithm
◦ Binary Search is a searching algorithm used in a sorted array by repeatedly dividing the search
interval in half. The idea of binary search is to use the information that the array is sorted and
reduce the time complexity to O(Log n)
◦ Example:
Input: arr[] = {10, 20, 30, 50, 60, 80, 110, 130, 140, 170}, x = 110
Output: 6
Explanation: Element x is present at index 6.
Binary Search Algorithm can be implemented in the following two ways
1. Iterative Method
2. Recursive Method
Iteration Method:
binarySearch(arr, x, low, high)
repeat till low = high
mid = (low + high)/2
if (x == arr[mid])
return mid
else if (x > arr[mid]) // x is on the right
side
low = mid + 1
else // x is on the left side
high = mid - 1
Recursive Method:
binarySearch(arr, x, low, high)
if low > high
return False
else
mid = (low + high) / 2
if x == arr[mid]
return mid
else if x > arr[mid] // x is on the right side
return binarySearch(arr, x, mid + 1, high)
else // x is on the left side
return binarySearch(arr, x, low, mid - 1)
Recursion:
◦ In general terms recursion means the process to define a problem or the solution for
a problem in a much simpler way compared to the original version. It is a problem-
solving programming technique that has a remarkable and unique characteristic.
◦ In recursion in data structure, a method or a function has the capability to decode an
issue. In the process of recursion, a problem is resolved by transforming it into small
variations of itself. In this procedure, the function can call itself either directly or
indirectly. Based on the differences in call recursion in data structure can be
categorized into different categories. You will get to know about these categories
later in the blog.
◦ Recursion in data structure is additionally an adequate programming technique. A
recursive subroutine is described as one that directly or indirectly calls itself. Calling a
subroutine specifically indicates that the characterization of the subroutine already
has the call statement of calling the subroutine that has been defined.
Example on Recursion:
using namespace std;
// Factorial function
int f(int n)
{
// Stop condition
if ( n == 0 || n == 1 )
return 1;
// Recursive condition
else
return n * f(n – 1);
}
// Driver code
int main()
{
int n = 6;
cout<<“Required factorial of 6 “<<n<<” = “<<f(n);
return 0;
}
The output is displayed as:
Required factorial of 6 = 720
Binary Tree:
◦ Binary Tree is defined as a Tree data structure with at most 2 children. Since each
element in a binary tree can have only 2 children, we typically name them the left
and right child
◦ Binary Tree Representation
A Binary tree is represented by a pointer to the topmost node of the tree. If the tree is
empty, then the value of the root is NULL.
Binary Tree node contains the following parts:
1.Data
2.Pointer to left child
3.Pointer to right child
HEAP:
◦ A Heap is a special Tree-based data structure in which the tree is a complete binary tree.
◦ Operations of Heap Data Structure:
• Heapify: a process of creating a heap from an array.
• Insertion: process to insert an element in existing heap time complexity O(log N).
• Deletion: deleting the top element of the heap or the highest priority element, and then organizing
the heap and returning the element with time complexity O(log N).
• Peek: to check or find the most prior element in the heap, (max or min element for max and min
heap).
◦ Types of Heap Data Structure
Generally, Heaps can be of two types:
1.Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys
present at all of it’s children. The same property must be recursively true for all sub-trees in that
Binary Tree.
2.Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys
present at all of it’s children. The same property must be recursively true for all sub-trees in that
Binary Tree.
Course Outcomes
◦ Students who want to prepare themselves for interview of top companies like Google,
Amazon or Microsoft.
◦ Students who are looking forward to be an efficient programmer, who are having data
structures in their syllabus.
◦ Students who wants to have in dept knowledge about the Stack, Queue and Linked
List, Efficiency of Algorithm, Binary Tree, Heap
Weekly Quizzes- on UDEMY
Overall Grade= 100%
Certificate

More Related Content

Similar to MOOC Course on Data Structures and Algorithms Using C

Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm. Abdul salam
 
ADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdf
ADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdfADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdf
ADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdfRGPV De Bunkers
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsJulie Iskander
 
ADSA orientation.pptx
ADSA orientation.pptxADSA orientation.pptx
ADSA orientation.pptxKiran Babar
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.pptSeethaDinesh
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxR S Anu Prabha
 
Study on Sorting Algorithm and Position Determining Sort
Study on Sorting Algorithm and Position Determining SortStudy on Sorting Algorithm and Position Determining Sort
Study on Sorting Algorithm and Position Determining SortIRJET Journal
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfAxmedcarb
 
Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingMvenkatarao
 
DATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptxDATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptxShivamKrPathak
 

Similar to MOOC Course on Data Structures and Algorithms Using C (20)

Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
 
CSE 443 (1).pptx
CSE 443 (1).pptxCSE 443 (1).pptx
CSE 443 (1).pptx
 
ADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdf
ADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdfADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdf
ADA Unit-1 Algorithmic Foundations Analysis, Design, and Efficiency.pdf
 
Data Structure
Data StructureData Structure
Data Structure
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
ADSA orientation.pptx
ADSA orientation.pptxADSA orientation.pptx
ADSA orientation.pptx
 
Data structure
Data structureData structure
Data structure
 
Queues
QueuesQueues
Queues
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptx
 
Data structure
 Data structure Data structure
Data structure
 
Data Structures 6
Data Structures 6Data Structures 6
Data Structures 6
 
Study on Sorting Algorithm and Position Determining Sort
Study on Sorting Algorithm and Position Determining SortStudy on Sorting Algorithm and Position Determining Sort
Study on Sorting Algorithm and Position Determining Sort
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 
Introduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searchingIntroduction to Data Structures Sorting and searching
Introduction to Data Structures Sorting and searching
 
Data structures
Data structuresData structures
Data structures
 
U nit i data structure-converted
U nit   i data structure-convertedU nit   i data structure-converted
U nit i data structure-converted
 
DATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptxDATA STRUCTURES unit 1.pptx
DATA STRUCTURES unit 1.pptx
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

MOOC Course on Data Structures and Algorithms Using C

  • 1. 18ECCP101L MASSIVE OPEN ONLINE COURSE(MOOCS) - 1 PLATFORM – Udemy Done By – K.JASWANTH (RA2011004010013)
  • 2. Course Details ◦ Course Platform – Udemy ◦ Course Title – Fundamental Data Structures & Algorithms Using C language ◦ Created By – Shibaji Paul ◦ Duration – 15h 41m
  • 4. Introduction ◦ This course will help the students ability to grasp the knowledge of data structures and algorithm using the C programming language. Knowledge of Data Structures and Algorithms are essential in developing better programming skills. ◦ This course is based on the standard curriculum of Universities across the globe for graduate level engineering and computer application course. ◦ Apart from step by step development of concepts students will also learn how to write algorithms and then how to write programs based on the algorithms in this course. ◦ Students who want to prepare themselves for interview of top companies like Google, Amazon or Microsoft. Students who are looking forward to be an efficient programmer, who are having data structures in their syllabus. Students who wants to have in dept knowledge about the Stack, Queue and Linked List, Efficiency of Algorithm, Binary Tree, Heap
  • 5. Course Overview ◦ Total 14 Sections ◦ Introduction to the course ◦ All about stack ◦ Parenthesis checking using stack ◦ Polish notation and Reverse Polish notation ◦ All about Queue ◦ Linked list ◦ Singly Linked list ◦ Doubly Linked list ◦ Circular Linked list ◦ Efficiency of Algorithm ◦ Binary search ◦ Recursion ◦ Binary Tree and Binary search tree ◦ Heap
  • 20. Stack ◦ A stack is a linear data structure, collection of items of the same type. ◦ Stack follows the Last In First Out (LIFO) fashion wherein the last element entered is the first one to be popped out. ◦ In stacks, the insertion and deletion of elements happen only at one endpoint of it. ◦ Operations performed on Stacks The following are the basic operations served by the Stacks. • Push: This function adds an element to the top of the Stack. • Pop: This function removes the topmost element from the stack. • IsEmpty: Checks whether the stack is empty. • IsFull: Checks whether the stack is full. • Top: Displays the topmost element of the stack.
  • 22. Polish Notation ◦ Polish notation is a notation form for expressing arithmetic, logic and algebraic equations. Its most basic distinguishing feature is that operators are placed on the left of their operands. If the operator has a defined fixed number of operands, the syntax does not require brackets or parenthesis to lessen ambiguity. ◦ Polish notation is also known as prefix notation, prefix Polish notation, normal Polish notation, Warsaw notation and Lukasiewicz notation. ◦ Example: ◦ Infix notation with parenthesis: (3 + 2) * (5 – 1) ◦ Polish notation: * + 3 2 – 5 1
  • 23. Reverse notation ◦ Reverse Polish notation (RPN) is a method for conveying mathematical expressions without the use of separators such as brackets and parentheses. In this notation, the operators follow their operands, hence removing the need for brackets to define evaluation priority. The operation is read from left to right but execution is done every time an operator is reached, and always using the last two numbers as the operands. This notation is suited for computers and calculators since there are fewer characters to track and fewer operations to execute. ◦ So in a computer using RPN, the evaluation of the expression 5 1 – 3 * is as follows: 1.Push 5 into the stack. This is the first value. 2.Push 1 into the stack. This is the second value and is on the position above the 5. 3.Apply the subtraction operation by taking two operands from the stack (1 and 5). The top value (1) is subtracted from the value below it (5), and the result (4) is stored back to the stack. 4 is now the only value in the stack and is in the bottom. 4.Push 3 into the stack. This value is in the position above 4 in the stack. 5.Apply the multiplication operation by taking the last two numbers off the stack and multiplying them. The result is then placed back into the stack. After this operation, the stack now only contains the number 12.
  • 24. QUEUE ◦ A queue in C is basically a linear data structure to store and manipulate the data elements. It follows the order of First In First Out (FIFO). ◦ In queues, the first element entered into the array is the first element to be removed from the array. ◦ A queue is open at both ends. One end is provided for the insertion of data and the other end for the deletion of data. ◦ A queue is open at both ends. One end is provided for the insertion of data and the other end for the deletion of data. ◦ A queue can be implemented with any programming language such as C, Java, Python, etc.
  • 26. Linked List ◦ A linked list is a sequence of data structures, which are connected together via links. Linked List is a sequence of links which contains items. Each link contains a connection to another link. Linked list is the second most-used data structure after array. ◦ The size of the arrays is fixed: So we must know the upper limit on the number of elements in advance. Also, generally, the allocated memory is equal to the upper limit irrespective of the usage.
  • 28. Singly Linked list ◦ Singly linked list is the most common linked list among the others. The singly linked list can be traversed only in one direction. It is a collection of ordered sets of elements. In singly linked list, Each node has a data and a pointer to the next node. ◦ Syntax struct node { int data; struct node *next; }
  • 29. Double Linked List ◦ In the doubly linked list, we add a pointer to the previous node and also to the next node. The Doubly linked list can be traversed in two directions such as forward and backward. ◦ Syntax struct node { int data; struct node *next_node; struct node *previous_node; }
  • 30. Circular Linked List ◦ The circular linked list is a linked list where all nodes are connected to form a circle. In a circular linked list, the first node and the last node are connected to each other which forms a circle. There is no NULL at the end.Syntax syntax: class Node{ int value; // Points to the next node. Node next; }
  • 31. There are two types of circular linked list those are 1.circular singly linked list 2.circular doubled linked list ◦ Circular singly linked list: In a circular Singly linked list, the last node of the list contains a pointer to the first node of the list. We traverse the circular singly linked list until we reach the same node where we started. The circular singly linked list has no beginning or end. No null value is present in the next part of any of the nodes. ◦ Circular Doubly Linked List has properties of both doubly linked list and circular linked list in which two consecutive elements are linked or connected by the previous and next pointer and the last node points to the first node by the next pointer and also the first node points to the last node by the previous pointer.
  • 32. Efficiency of Algorithm: ◦ In computer science, algorithmic efficiency is a property of an algorithm which relates to the amount of computational resources used by the algorithm ◦ Efficiency of an algorithm is measured by assuming that all other factors, for example, processor speed, are constant and have no effect on the implementation. A Posterior Analysis − This is an empirical analysis of an algorithm. The selected algorithm is implemented using programming language. ◦ One way to measure the efficiency of an algorithm is to count how many operations it needs in order to find the answer across different input sizes.
  • 33. Binary search algorithm ◦ Binary Search is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(Log n) ◦ Example: Input: arr[] = {10, 20, 30, 50, 60, 80, 110, 130, 140, 170}, x = 110 Output: 6 Explanation: Element x is present at index 6.
  • 34. Binary Search Algorithm can be implemented in the following two ways 1. Iterative Method 2. Recursive Method Iteration Method: binarySearch(arr, x, low, high) repeat till low = high mid = (low + high)/2 if (x == arr[mid]) return mid else if (x > arr[mid]) // x is on the right side low = mid + 1 else // x is on the left side high = mid - 1 Recursive Method: binarySearch(arr, x, low, high) if low > high return False else mid = (low + high) / 2 if x == arr[mid] return mid else if x > arr[mid] // x is on the right side return binarySearch(arr, x, mid + 1, high) else // x is on the left side return binarySearch(arr, x, low, mid - 1)
  • 35. Recursion: ◦ In general terms recursion means the process to define a problem or the solution for a problem in a much simpler way compared to the original version. It is a problem- solving programming technique that has a remarkable and unique characteristic. ◦ In recursion in data structure, a method or a function has the capability to decode an issue. In the process of recursion, a problem is resolved by transforming it into small variations of itself. In this procedure, the function can call itself either directly or indirectly. Based on the differences in call recursion in data structure can be categorized into different categories. You will get to know about these categories later in the blog. ◦ Recursion in data structure is additionally an adequate programming technique. A recursive subroutine is described as one that directly or indirectly calls itself. Calling a subroutine specifically indicates that the characterization of the subroutine already has the call statement of calling the subroutine that has been defined.
  • 36. Example on Recursion: using namespace std; // Factorial function int f(int n) { // Stop condition if ( n == 0 || n == 1 ) return 1; // Recursive condition else return n * f(n – 1); } // Driver code int main() { int n = 6; cout<<“Required factorial of 6 “<<n<<” = “<<f(n); return 0; } The output is displayed as: Required factorial of 6 = 720
  • 37. Binary Tree: ◦ Binary Tree is defined as a Tree data structure with at most 2 children. Since each element in a binary tree can have only 2 children, we typically name them the left and right child ◦ Binary Tree Representation A Binary tree is represented by a pointer to the topmost node of the tree. If the tree is empty, then the value of the root is NULL. Binary Tree node contains the following parts: 1.Data 2.Pointer to left child 3.Pointer to right child
  • 38. HEAP: ◦ A Heap is a special Tree-based data structure in which the tree is a complete binary tree. ◦ Operations of Heap Data Structure: • Heapify: a process of creating a heap from an array. • Insertion: process to insert an element in existing heap time complexity O(log N). • Deletion: deleting the top element of the heap or the highest priority element, and then organizing the heap and returning the element with time complexity O(log N). • Peek: to check or find the most prior element in the heap, (max or min element for max and min heap). ◦ Types of Heap Data Structure Generally, Heaps can be of two types: 1.Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree. 2.Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree.
  • 39.
  • 40. Course Outcomes ◦ Students who want to prepare themselves for interview of top companies like Google, Amazon or Microsoft. ◦ Students who are looking forward to be an efficient programmer, who are having data structures in their syllabus. ◦ Students who wants to have in dept knowledge about the Stack, Queue and Linked List, Efficiency of Algorithm, Binary Tree, Heap
  • 41. Weekly Quizzes- on UDEMY Overall Grade= 100%
  • 42.