Chetan Dattachetan77.hashnode.dev·Sep 22, 2024Implementing DFS Using a StackHere 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...DiscussLeetcodeinorder
Chetan Dattachetan77.hashnode.dev·Jul 27, 2024LL 1 - Single Linked ListConstruction 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...DiscussLeetcodelinked list
Subhradeep Sahasubhradeepsaha.hashnode.dev·May 2, 2024Solving a Leetcode problem daily — Day 5 | Diagonal Traversehttps://medium.com/@subhradeep_saha/solving-a-leetcode-problem-daily-day-5-diagonal-traverse-17b173927e95 Here is the Leetcode problem: https://leetcode.com/explore/learn/card/array-and-string/202/introduction-to-2d-array/1167/ Problem Statement ...DiscussSolving a Leetcode problem dailytraversal
Anurag Pathakanurag-pathak.hashnode.dev·Mar 29, 2023Weird Traversals in Binary TreeLet'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...Discuss·10 likes·162 readsBinary TreesBinaryTrees