All Questions
6 questions
1
vote
1
answer
85
views
Don't include root directory in HTML tree
I've written a function to create an HTML tree from JSON.
...
3
votes
0
answers
329
views
reverse recursive search on an object with javascript - like tree search
I implemented a tree search with JavaScript.
It has below basic rules.
It will search over an array of objects which has recursive(like fractal)
If it found a according data in a leaf(the final depth ...
4
votes
0
answers
143
views
All the paths from the root to the leaves
Given a binary tree, return all root-to-leaf paths.
Example:
-- 1
/ \
2 3
\
5
Output should be: ["1->2->5", "1->3"]
My approach: I walk the branches ...
3
votes
1
answer
2k
views
Return path to a value in a nested object
Description:
Its not a programming challenge but I though to write a small utility which will return the path to a primitive value in a possibly nested object. The idea is not original.
Code:
...
5
votes
1
answer
13k
views
Creating a menu as nested unordered lists from JSON data
I have a JSON input using which I have written below function to recursively create an unordered list.
Is there more precise way to achieve it?
...
29
votes
2
answers
63k
views
Recursion vs iteration of tree structure
Some recursive code is part of a particularly slow path of a project. Out of curiosity I was playing around with reimplementing the code using stack context iteration instead of recursion. Below are ...