dimanche 28 juin 2015

AngularJS Binary Tree w/ Breadth First Search

Transitioning from C++ into web development and am curious about BST and data structures in general in AngularJS.

I would like to create a BST with a breadth-first search option. In C++, I'd create a node with a left and right pointer. Then use a queue to enqueue the root node, see if matches the desired value and if it does not, push the child elements and dequeue the root.

I am not really sure where to begin with this in AngularJS, as there are no nodes and pointers. It seems the functionality for creating/manipulating your own datastructures is not as flexible. When performing an $http.get(), I would like to store the data in a BST and search for items with BFS.

Can anyone suggest a starting place? Would using pure JavaScript to create a custom data structure be preferrable?

Aucun commentaire:

Enregistrer un commentaire