Comments (2)
Apologies for the delay! Can you clarify, please?
Can you please enhance your brilliant code implementing (pseudocode) as follows:
- $branch = $node->getBranch($childNode)
This should return an array defining $childNode (what is a child node of $node) with all its children.
I'm unsure what you mean by that, can you elaborate?
- What node does
$node
refer to? - What node does
$childNode
refer to? Should it be a direct child of$node
? - What should the structure of
$branch
look like? A list of nodes? Which nodes?
from tree.
Hi,
The node is:
$node = new Node('foo');
$childNode is a direct child of a $node.
A $branch should be a structure keeping all information about a $childNode and all its children with their children and their children, etc. So, formally a $branch is a sub-tree.
The idea is to easily manipulate tree structure, like moving the entire branches (sub-trees) between nodes rather than re-creating them recursively.
from tree.
Related Issues (19)
- Convert to array HOT 1
- How to Traverse the entire Tree ? HOT 2
- Enable Sourcegraph HOT 1
- Use String key to represent a Node HOT 1
- Iterable Node and Proxy Node HOT 1
- Add variable-length argument lists in `NodeBuilder::leafs()`
- Can one child object be associated with multiple parent objects in this ? HOT 3
- PHP Warning: Undefined array key -1 HOT 1
- [Enhancement] Big children size issue
- Problem with builder : tree are not children HOT 2
- fill tree with node contains parent HOT 7
- Deleting children in a Visitor cause Fatal error HOT 1
- Bug or Feature: getAncestors returns leaf HOT 5
- Create a node HOT 1
- Improve traverse tree
- Level order traversal HOT 1
- Depth of a Node HOT 3
- Semantics... HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree.