Looking to build a tree structure from a given list of data where the paths are represented like:
A-->B-->C-->D-->E..
A-->B-->C-->D-->F..
A-->F-->C-->D-->E..
.
.
.
All possible data paths are stored in an array. The desired output should look like:
A
-B
-C
-D
-E
-F
-F
-C
-D
-E
Is there a way to achieve this using JavaScript? I am looking for a function called createTreeFunction :)
function parseData(data)
{
$.each(data, function (i, p) {
var arr = p.split("--->");
createTreeFunction(p);
});
};
function parseData(data)
{
$.each(data, function (i, p) {
var arr = p.split("--->");
createTreeFunction(p);
});
};