---
title: "Discussion on \"Implementing DFS Using a Stack\" | Hashnode"
description: "Discussion on \"Implementing DFS Using a Stack\". Here we illustrates the implementation of DFS iteratively using stacks. For the recursive implementation of DFS refere this article.\nPreorder Traversal\nProblem\nGiven the root of a binary tree, return the preorder traversal of its nodes' values. (link..."
url: "https://hashnode.com/posts/implementing-dfs-using-a-stack/66f05060719c3a33ced9207b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [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...

Sep 22, 2024 · 7 min read · chetan77.hashnode.dev  
Read the article

-   [#inorder](https://hashnode.com/tag/inorder)
-   [#preorder](https://hashnode.com/tag/preorder)
-   [#postorder](https://hashnode.com/tag/postorder)
-   [#traversal](https://hashnode.com/tag/traversal)
-   [#trees](https://hashnode.com/tag/trees)
-   [#binarytrees](https://hashnode.com/tag/binarytrees)

## Written by

[Chetan Datta](https://hashnode.com/@chetan77)

@chetan77 · Hyderabad, India

  
[View profile](https://hashnode.com/@chetan77)

Software Engineer

I share my learnings here. Thanks for reading.

## Responses

Comments are turned off for this post.
