Tree Traversal #SalesforceSaturday
-
Upload
daniel-peter -
Category
Technology
-
view
141 -
download
3
Transcript of Tree Traversal #SalesforceSaturday
TREES IN APEX & JAVASCRIPT
DANIEL PETER@DANIELJPETER
SALESFORCE MVP
20X SALESFORCE CERTIFIED
BAY AREA SALESFORCE DEVELOPER GROUP LEADER
LEAD APPLICATIONS ENGINEER, KENANDY
OBJECTIVE
• Cover the practical uses of trees for a Salesforce Developer• Give you the best bang for the buck, not be exhaustive in theory
TREE STRUCTURE • nodes• root• parent• child / children• leaf• descendant• ancestor• ordered / non ordered• binary tree• depth• height
TREE TRAVERSAL - DEFINITION
• In computer science, tree traversal (also known as tree search) is a form of graph traversal and refers to the process of visiting (checking and/or updating) each node in a tree data structure, exactly once. Such traversals are classified by the order in which the nodes are visited.
- Wikipedia
TREE TRAVERSAL - TYPESpreorder
postorder
F, B, A, D, C, E, G, I, H.
A, C, E, D, B, H, I, G, F.
Depth First• preorder• postorder• inorder
Breadth First• levelorder
Other• Euler tour
RESOURCES• My Code: https://github.com/danieljpeter/ApexTreeTraversalDemo/
• Flat To Nested: https://github.com/joaonuno/flat-to-nested-js/blob/master/index.js
TAHOE DREAMIN’• JAN. 20-21, 2017 - 2 DAY SALESFORCE AWESOMENESS IN SOUTH LAKE TAHOE!
• http://www.tahoedreamin.com/
• Promocode: UserGroupMember