0% found this document useful (0 votes)
17 views9 pages

Basic Traversal and Searching Techniques

Uploaded by

vinaykyatham27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views9 pages

Basic Traversal and Searching Techniques

Uploaded by

vinaykyatham27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Basic Traversal and

Searching Techniques
This presentation will explore essential traversal and searching
techniques. These algorithms are fundamental building blocks for many
data structures and applications.

by Kyatham Vinay
Depth-First Search (DFS)
Recursive Algorithm Stack-Based

DFS systematically explores a graph by visiting each node DFS uses a stack to keep track of the nodes to be visited. It
and then all its unvisited neighbors. prioritizes exploring deeper branches before moving to
shallower ones.
Breadth-First Search (BFS)
Level-by-Level Queue-Based

BFS explores a graph by visiting all nodes at a particular BFS uses a queue to store nodes in the order of their
level before moving to the next level. discovery. It prioritizes exploring neighbors at the same
level.
Binary Search

Divide and Conquer


1

Sorted Array
2
Requires the input to be sorted.

Logarithmic Time
3
Divides the search space in half with each iteration.
Radix Sort
Non-Comparison- Linear Time
Based Can achieve linear time
Sorts elements by grouping complexity for certain input
them based on their digits. distributions.

Stable Sort
Maintains the relative order of equal elements.
Graph Traversal Algorithms

DFS BFS
Suitable for tasks like finding connected components, cycle Ideal for finding shortest paths in unweighted graphs and
detection, and topological sorting. determining if two nodes are connected.
Hashing and Hash Tables
Key-Value Storage Average Constant Time

Efficiently stores and retrieves data using a hash function. Provides fast lookup, insertion, and deletion operations.
Divide and Conquer Algorithms
1 Divide

2 Conquer

3 Combine
Time and Space Complexity
Analysis

O(n) O(log n)
Linear Logarithmic
Runtime grows proportionally to Runtime grows logarithmically
the input size. with the input size.

O(n log n)
Log-linear
Runtime grows at a rate between
linear and quadratic.

You might also like