# SKP's Algorithms and Data Structures #1

### My Article Series on Algorithms and Data Structures in a Sort of 'Programming Language Agnostic Way'. Few of the Algorithms and Data Structures in C, Few in C++, and Others in Core Java.

Join the DZone community and get the full member experience.

Join For Free*My Article Series on Algorithms and Data Structures in a Sort of 'Programming Language Agnostic Way'. Few of the Algorithms and Data Structures in C, Few in C++, and Others in Core Java. Assorted Collection for Learning, Revising, Revisiting, Quick Refresh, and a Quick Glance for Interviews. You May Even Include them Directly for Professional or Open Source Efforts. Have Included Explanation Only for Few of These! Hope these turn out to be Really Helpful as per the Author's Intention.*

### Graph Search or Traversal Algorithms

A graph is a set of connected vertices {V} and edges {E}. A graph may be connected, disconnected, weighted, or non-weighted. In other terms, a Graph could also be a tree with cycles. Graph Search or Traversal can be done in two ways as explained below:

**1. Depth First Search —**In this type of search, we begin at a vertex Vi and traverse through all vertices from Vi unto Vx depth-wise, until there is no adjacent vertex that is unvisited. Then we back up all the way up to an unvisited vertex Vy and continue. We continue until there are no unvisited vertices left. It represents

*in Algorithmic Problem Solving.*

__Backtracking__**2. Breadth-First Search —**In this type of search, we begin at a vertex Vi and traverse each vertex Vj that is reachable from there. Then we continue in the same way at every vertex reachable from Vj. It creates a queue of vertices visited from a given vertex and then deletes each of them if visited or after visiting them. The process is terminated once there is no non-visited vertex left. It represents

*in Algorithmic Problem Solving.*

__Dynamic Programming__Published at DZone with permission of Sumith Puri, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Comments