Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
Advice
0 votes
2 replies
37 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 ...
-1 votes
1 answer
93 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. ...
2 votes
3 answers
133 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 ...
-1 votes
1 answer
70 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 ...
1 vote
1 answer
115 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. ...
2 votes
1 answer
173 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 x has a left subtree, the inorder predecessor is the largest value in that ...
1 vote
1 answer
189 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 ...
0 votes
1 answer
56 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 ...
0 votes
1 answer
60 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 -&...
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 ...
-1 votes
1 answer
163 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) ...
0 votes
0 answers
49 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 ...
-1 votes
3 answers
146 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
49 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(...
1 vote
3 answers
162 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 ...

15 30 50 per page
1
2 3 4 5
...
57

AltStyle によって変換されたページ (->オリジナル) /