Skip to content

sv2506/WoflowTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

WoflowTest

I use a BFS method in this approach. Using the ID given as input, the code makes the GET request, and using some JSON parsing it retrieves all the "child_node_ids" for the parent.

It then iterates over the child nodes, makes sure that we have not visited the node already(To avoid an infinte loop) by checking against the HashMap that is defined which stores all unique nodes and their frequenct.

If node was not visited, then add it to the queue of nodes to visit. Simultaneously, update the frequency in the map.

The while loop will exit when we end up on a node that does not have any children and this causes the queue to become empty.

NOTE: In the initial commits, I was only able to add the logic but not the result. My JSON parser logic got a bit messed up since some of the dependencies were missing in my IDE.

In my final commit, I was able to fix the JSON parser.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages