This document summarizes a massive open online course on Udemy about fundamental data structures and algorithms using the C language. The 15-hour course covers key topics like stacks, queues, linked lists, trees, recursion, and analyzing algorithm efficiency. It aims to help students strengthen programming skills and prepare for technical interviews at top companies. The course consists of 14 sections and includes weekly quizzes on the Udemy platform.
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