Find the Lead Manager Part 2 - Creating a Binary Tree of Employee Ids | Apex Data Structure Tutorial

preview_player
Показать описание
Hello Trailblazers, In this tutorial we're going to create a binary tree of Employee Ids in order to solve the problem: "Find the Lead Manager". We're going to use the previous concepts where we learned, how can we insert a node in a binary tree based on the value of parent node. We're going to insert each employee one by one in the binary tree and for each employee, we'll insert the employees reporting to it after the current employee is inserted.

Chapters:
0:00 Introduction
0:21 Finding the top most Employee record
2:50 Querying Employee records to form Employee Map
6:03 Initial Explanation
6:45 Id Compare Class
8:50 Creating a Binary Tree using Employee Map
18:08 Overview of Lowest Common Ancestor
19:38 Wrapping up

Рекомендации по теме
Комментарии
Автор

What could be another solution if we don't want to query all the employees every time. If we have 50K+ records then this solution will not work.

viharsomani