Ravin DR
Ravin DR
Ravin DR
Name:-ravindranath soren
b.roll:-16301060037
Page 1 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 2 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 3 of 18
Sorting Techniques
Sorting refers to arranging data in a particular format. Sorting
algorithm specifies the way to arrange data in a particular order.
Most common orders are in numerical or lexicographical order.
The importance of sorting lies in the fact that data searching can
be optimized to a very high level, if data is stored in a sorted
manner. Sorting is also used to represent data in more readable
formats. Following are some of the examples of sorting in real-
life scenarios −
Name:-ravindranath soren
b.roll:-16301060037
Page 4 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 5 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 6 of 18
Stack
A stack is an Abstract Data Type (ADT), commonly used in
most programming languages. It is named stack as it behaves
like a real-world stack, for example – a deck of cards or a pile
of plates, etc.
A real-world stack allows operations at one end only. For
example, we can place or remove a card or plate from the top
of the stack only. Likewise, Stack ADT allows all data operations
at one end only. At any given time, we can only access the top
element of a stack.
This feature makes it LIFO data structure. LIFO stands for Last-
infirst-out. Here, the element which is placed (inserted or
added) last, is accessed first. In stack terminology, insertion
operation is called PUSH operation and removal operation is
called POP operation.
Name:-ravindranath soren
b.roll:-16301060037
Page 7 of 18
Name:- ravindranath soren
b.roll:-16301060037
Page 8 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 9 of 18
Queue
Queue is an abstract data structure, somewhat similar to Stacks. Unlike
stacks, a queue is open at both its ends. One end is always used to insert
data (enqueue) and the other is used to remove data (dequeue). Queue
follows First-In-First-Out methodology, i.e., the data item stored first will
be accessed first.
A real-world example of queue can be a single-lane one-way road, where
the vehicle enters first, exits first. More real-world examples can be seen
as queues at the ticket windows and bus-stops. understand the basic
operations associated with queues − enqueue() − add (store) an
item to the queue Basic Operations
• Queue operations may involve initializing or defining the
Name:-ravindranath soren
b.roll:-16301060037
Page 10 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 11 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 12 of 18
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. Following are the
important terms to understand the concept of Linked List.
• Link − Each link of a linked list can store a data called an
element.
• Next − Each link of a linked list contains a link to the next link
called Next.
• LinkedList − A Linked List contains the connection link to the
first link called First.
Name:-ravindranath soren
b.roll:-16301060037
Page 13 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 14 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 15 of 18
Recursion
Recursion is the process of repeating items in a self-similar way. In programming
languages, if a program allows you to call a function inside the same function, then
it is called a recursive call of the function.
The C programming language supports recursion, i.e., a function to call itself. But
while using recursion, programmers need to be careful to define an exit condition
from the function, otherwise it will go into an infinite loop.
Recursive functions are very useful to solve many mathematical problems, such as
calculating the factorial of a number, generating Fibonacci series, etc.
Number Factorial
The page 17 example calculates the factorial of a given number using a
recursive function
− Fibonacci Series
The page 18 example generates the Fibonacci series for a given number
using a recursive function −
Name:-ravindranath soren
b.roll:-16301060037
Page 16 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 17 of 18
Name:-ravindranath soren
b.roll:-16301060037
Page 18 of 18