Document (3) (2) (2)
Document (3) (2) (2)
IOT CAMPUS
Department Of Computer Engineering
Algorithm Assignment
5. Exponential Search:
• BFS: Explores all neighbors at the current level before moving to the
next level. Used in:
* Finding the shortest path in an unweighted graph: Used in GPS
navigation systems or network routing.
* Social networking: Finding connections between people.
* Crawling websites: Discovering links on a website.
Recursion algorithm
Recursion is a method employed in computer science to address
complex issues by decomposing them into smaller, analogous problems.
The mechanism whereby a function invokes itself, either directly or
indirectly, is referred to as recursion, and the function that performs
this action is known as a recursive function. By utilizing a recursive
algorithm, certain challenges can be resolved with relative ease.
Graph algorithms
Graph algorithms are techniques employed to manipulate and analyze
graphs, addressing a variety of problems such as identifying the shortest
path and detecting cycles. There exists a range of graph algorithms,
including:
i. Breadth-First Search
Graph traversal is essential for graph processing. The breadth-first
search (BFS) method explores a graph in a level-wise manner. Beginning
from a selected node, it visits all adjacent nodes before proceeding to
their neighbors, and continues this process. Unlike trees, graphs may
contain cycles, necessitating that BFS keeps track of visited nodes to
prevent infinite loops from revisiting the same nodes.
Sorting applications
• Bubble Sort: Rarely used in practice for large datasets due to its O(n²)
time complexity. It might be used for educational purposes or in
extremely simple situations with very few elements where simplicity
trumps efficiency. It's not efficient enough for anything significant.