---
title: "#traversal articles | Hashnode"
description: "Explore 8 articles tagged #traversal on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/traversal"
---

Tag

# #traversal

8 posts · 0 followers

[Chetan Datta](https://hashnode.com/@chetan77) · [Aug 3, 2025](https://hashnode.com/posts/bfs-and-dfs-of-graph-traversal/688faad4a560602db4724828)

### [BFS and DFS of Graph traversal](https://chetan77.hashnode.dev/bfs-and-dfs-of-graph-traversal?utm_source=hashnode&utm_medium=feed)

BFS Given a connected undirected graph containing V vertices, represented by a 2-d adjacency list adj\[\]\[\], where each adj\[i\] represents the list of vertices connected to vertex i. Perform a Breadth First Search (BFS) traversal starting from vertex 0,...

4 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/bfs-and-dfs-of-graph-traversal?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jul 25, 2025](https://hashnode.com/posts/construct-binary-tree-from-preorder-and-inorder-traversal/6883cd4f41144f381c3c3afc)

### [Construct Binary Tree from Preorder and Inorder Traversal](https://chetan77.hashnode.dev/construct-binary-tree-from-preorder-and-inorder-traversal?utm_source=hashnode&utm_medium=feed)

Problem Statement Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. (link) Example 1: Input: preorder ...

2 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/construct-binary-tree-from-preorder-and-inorder-traversal?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jun 22, 2025](https://hashnode.com/posts/vertical-order-traversal-of-a-binary-tree/6857d275b6115e8699fc799b)

### [Vertical Order Traversal of a Binary Tree](https://chetan77.hashnode.dev/vertical-order-traversal-of-a-binary-tree?utm_source=hashnode&utm_medium=feed)

Problem Statement Given the root of a binary tree, calculate the vertical order traversal of the binary tree. For each node at position (row, col), its left and right children will be at positions (row + 1, col - 1) and (row + 1, col + 1) respectivel...

4 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/vertical-order-traversal-of-a-binary-tree?utm_source=hashnode&utm_medium=feed)

[Shadab Ali](https://hashnode.com/@shaddyCracker) · [May 21, 2025](https://hashnode.com/posts/987-vertical-order-traversal-of-a-binary-tree-hard/682d6c7d71ff57b6400079eb)

### [987\. Vertical Order Traversal of a Binary Tree (Hard)](https://vertical-order-traversal-of-a-binary-tree.hashnode.dev/987-vertical-order-traversal-of-a-binary-tree-hard?utm_source=hashnode&utm_medium=feed)

solution of Leetcode binary traversal vertical order traversal approach wrong and right O(N. log N)

2 min read · [vertical-order-traversal-of-a-binary-tree.hashnode.dev](https://vertical-order-traversal-of-a-binary-tree.hashnode.dev/987-vertical-order-traversal-of-a-binary-tree-hard?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Sep 22, 2024](https://hashnode.com/posts/implementing-dfs-using-a-stack/66f05060719c3a33ced9207b)

### [Implementing DFS Using a Stack](https://chetan77.hashnode.dev/implementing-dfs-using-a-stack?utm_source=hashnode&utm_medium=feed)

Here we illustrates the implementation of DFS iteratively using stacks. For the recursive implementation of DFS refere this article. Preorder Traversal Problem Given the root of a binary tree, return the preorder traversal of its nodes' values. (link...

7 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/implementing-dfs-using-a-stack?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Jul 27, 2024](https://hashnode.com/posts/ll-1-single-linked-list/66a4db16a9d2be0dd0b40c09)

### [LL 1 - Single Linked List](https://chetan77.hashnode.dev/ll-1-single-linked-list?utm_source=hashnode&utm_medium=feed)

Construction of Linked List Input: n = 5 arr = \[1,2,3,4,5\] Output: 1 2 3 4 5 Explanation: Linked list for the given array will be 1->2->3->4->5 Here, the head points to a dummy which doesn't store anything. Later, when we return the new head pointer...

3 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/ll-1-single-linked-list?utm_source=hashnode&utm_medium=feed)

[Subhradeep Saha](https://hashnode.com/@subhradeepsaha) · [May 2, 2024](https://hashnode.com/posts/solving-a-leetcode-problem-daily-day-5-diagonal-traverse-17b173927e95/6635ed97fb3555a23edc1831)

### [Solving a Leetcode problem daily — Day 5 | Diagonal Traverse](https://subhradeepsaha.hashnode.dev/solving-a-leetcode-problem-daily-day-5-diagonal-traverse-17b173927e95?utm_source=hashnode&utm_medium=feed)

Slay Leetcode’s Diagonal Traversal problem with this detailed C++ guide - code breakdown, dry run with diagrams, & real-world applications.

8 min read · [subhradeepsaha.hashnode.dev](https://subhradeepsaha.hashnode.dev/solving-a-leetcode-problem-daily-day-5-diagonal-traverse-17b173927e95?utm_source=hashnode&utm_medium=feed)

[Anurag Pathak](https://hashnode.com/@pathakanurag) · [Mar 29, 2023](https://hashnode.com/posts/weird-traversals-in-binary-tree/64245e0c72a3ad4593179a67)

### [Weird Traversals in Binary Tree](https://anurag-pathak.hashnode.dev/weird-traversals-in-binary-tree?utm_source=hashnode&utm_medium=feed)

Let's have a look at some more traversals which are not that standard but will help you to expand your control over Binary trees. Spiral Traversal In this traversal, we need to print the nodes in a zig-zag format. As you can see in the above example...

7 min read · [anurag-pathak.hashnode.dev](https://anurag-pathak.hashnode.dev/weird-traversals-in-binary-tree?utm_source=hashnode&utm_medium=feed)
