Skip to main content
Advice
0 votes
2 replies
34 views

I'm in college learning about DFS and BFS. I knew about this before, although what's throwing me in a loop is DFSVisit. I just want to know what's the difference between DFS and DFSVisit. Is DFS just ...
Johanna's user avatar
-1 votes
1 answer
91 views

I'm trying to solve the Binary Tree Longest Consecutive Sequence II problem (Leetcode 549). The goal is to find the length of the longest consecutive path (increasing or decreasing) in a binary tree. ...
fortnight learner's user avatar
2 votes
3 answers
131 views

I'm having a problem with a little function that's supposed to count nodes and leaves in a tree. This is what it looks like: (defn count-tree "Count nodes and leaves in a tree as produced by ...
kamwitsta's user avatar
  • 460
-1 votes
1 answer
68 views

I was doing the GeeksforGeeks practice problem Vertical Tree Traversal: Given a root of a Binary Tree, find the vertical traversal of it starting from the leftmost level to the rightmost level. If ...
Sandesh Dubey's user avatar
1 vote
1 answer
114 views

I’m working on a problem where I need to compare multiple lineages (family trees) to check if they are structurally identical. Each lineage starts from a single root (ancestor) and extends downwards. ...
Bishop_1's user avatar
2 votes
1 answer
168 views

I'm trying to understand the rules for finding the inorder predecessor of a node in a binary search tree (BST). If a node 𝑥 has a left subtree, the inorder predecessor is the largest value in that ...
Aslam Sha's user avatar
1 vote
1 answer
179 views

In a Binary Search Tree (BST), I am trying to understand the properties of the inorder predecessor, particularly for nodes that have a left subtree. Definition: The inorder predecessor of a node is ...
Aslam Sha's user avatar
0 votes
1 answer
54 views

I have a tree which contains links between multiple nodes. I also have a dataframe with 1 million rows. There is a mapping between tree nodes and dataframe columns as follows: import networkx as nx ...
Sreekar Mouli's user avatar
0 votes
1 answer
59 views

void inorderPredecessor(Node* root, Node* &pre,int key){ if(root == NULL ) return ; if(root -> data == key){ inorderPredecessor(root ->left , pre , key); }else if(root -&...
abhinav550's user avatar
2 votes
1 answer
58 views

My question is with traversing. In my problem the sequence of the traversal is not following as it should. I am using the general logic for the inorder, preorderand the postorder traversal but it is ...
mehrab.4's user avatar
-1 votes
1 answer
157 views

I have seen answers indicating that there is something intrinsically non-recursive about level-order traversal. I suggest it can be done recursively in a very natural way (Node is defined as expected) ...
releseabe's user avatar
  • 329
0 votes
0 answers
47 views

I created a program that parses each one of the elements of an HTML Document. It saves it in a Tree strcuture(unbalanced tree). public class Attribute { public string? Key { get; set; } public ...
Ivan's user avatar
  • 1
-1 votes
3 answers
144 views

spec: replicas: 1 strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 0 selector: matchLabels: app.kubernetes.io/name: myapp app.kubernetes.io/instance: myapp I ...
user avatar
0 votes
1 answer
47 views

I am trying to recover a binary search tree using morris traversal. /** * Definition for binary tree * class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(...
Ajay Satpati's user avatar
1 vote
3 answers
160 views

I want to iteratively return the state of the binary tree until the infection is unable to spread to a new node. So how it goes is that the virus will spread to any directly adjacent healthy node and ...
KushKage's user avatar

15 30 50 per page
1
2 3 4 5
57