Linked List
Types of Linked List
Singly Linked List
Doubly Linked List
Circular Linked List
Circular Doubly List
Skip list in DS

DS Queue
Types of Queues
Array Representation
Linked List Representation
Circular Queue
Deque
Priority Queue

Bubble Sort
Bucket Sort
Comb Sort
Counting Sort
Heap Sort
Insertion Sort
Merge Sort
Quick Sort
Radix Sort
Selection Sort
Shell Sort
Bitonic Sort
Cocktail Sort
Cycle Sort
Tim Sort

Linear vs non-linear
Array vs linked list
Stack vs queue
Linear vs Circular Queue
Linear Search vs Binary Search
Singly Linked List vs Doubly Linked List
Binary vs Binary Search Tree
Tree vs Graph
Binary Search tree vs AVL tree
Red Black Tree vs AVL tree
B tree vs B+ tree
Quick Sort vs Merge Sort
BFS vs DFS
Stack vs Heap
Bubble sort vs. Selection sort
Stack vs Array
Full Binary Tree vs Complete Binary Tree
Binary Tree vs B Tree
Primitive vs non-primitive data structure
Data types vs data structure

Trie Data Structure
Heap Data Structure
Splay Tree
Fundamental of the DS
Hash Table
Preorder Traversal
Tree Traversal
Implementation of Queue using Stacks
Implementation of Stack using Queue
Binomial Heap
Postorder Traversal
Sparse Matrix
Detect loop in a Linked list
Inorder Traversal
Convert Infix to Postfix notation
Convert infix to prefix notation
Conversion of Prefix to Postfix expression
Conversion of Postfix to Prefix expression
Remove the loop in a Linked List
Implement two stacks in an array
Reverse a stack using recursion
Detect cycle in a directed graph
Optimal Binary Search Tree
Priority Queue using Linked list
Balanced Binary Search Tree
Boundary Traversal of Binary tree
Diagonal Traversal of Binary Tree
Vertical Traversal of a Binary tree
Graph Algorithms
Time Complexity of Sorting Algorithms
Applications of Stack in Data Structure
Dictionary Data Structure
Structured Data and Unstructured Data
List Data Structure
Types of Tree in Data Structure
Abstract data type in data structure
Disjoint set data structure
Dynamic Data Structure
Hash Function in Data Structure
Complete Binary Tree
Threaded Binary Tree
Diameter of Binary Tree
Height of Binary Tree
Inorder Tree Traversal without Stack
Enumeration of Binary Trees
Maximum Width of a Binary Tree
Types of Graph in Data Structure
Primitive Data Type
Semi-Structured Data
Advance Data Structures
Sort an Array of 0's, 1's, and 2's
Stock Span Problem
Implementation of Deque by Circular Array
Rotate Operation in Linked List
Subarray with given sum
Self-organizing List
Unrolled Linked List
Types of Sparse Matrices
Application of Linked List
Topological Sorting
Ternary Search Tree
Stock Span Problem
Treap Data Structure
Quicksort on Doubly Linked List
Inversion count
Expression tree in DS
Garbage Collection in DS
Merge Sort on Doubly Linked List
Sort Stack using Recursion
LIFO Approach in data structure
Big O Notation in DS
Binary Tree Traversal in DS
Queue Operations in DS
What is a Non-Linear Data Structure
FIFO Approach in data structure
What are connected graphs in data structure
Which Python data structure is immutable
Which data structure is used by map
What is iteration in data structure
What are linear search and binary search in data structure
Hash Table vs STL Map
Recaman's Sequence
Maximum area rectangle created by selecting four sides from an array
Maximum number of distinct nodes in a root-to-leaf path
Hashing - Open Addressing for Collision Handling
Introduction to Hashing
Separate chaining for Collision Handling
Check if a given array contains duplicate elements within k distance from each other
Given an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)
Find number of Employees Under every Manager
Union and Intersection of two Linked Lists
Kth Largest element in an array
Sort an almost-sorted, k-sorted or nearly-sorted array
Fibonacci Heap
Find whether an array is subset of another array
Print a Binary Tree in Vertical Order
Tournament Tree (Winner Tree)
Lazy Propagation in Segment Tree
Segment Tree - Range Minimum Query
Segment Tree - Sum of given Range
2-3 Trees (Search, Insertion, and Deletion)
Print kth least significant bit of a number
Add two numbers represented by linked lists
Adding one to the number represented as array of digits
Find precedence characters form a given sorted dictionary
Check if any anagram of a string is palindrome or not
Minimum Insertions to form a Palindrome
Allocate Minimum Number of Pages
Assembly Line Scheduling
Breadth First Search or BFS for a Graph
Find an element in array such that sum of the left array is equal to the sum of the right array
Bridges in a Graph
Bubble Sort in JavaScript
Burn the Binary tree from the Target node
Lowest Common Ancestor in a Binary Search Tree
Types of Hash Functions in C
Implement Dynamic Deque using Templates Class and a Circular Array
Iterative Depth First Traversal of Graph
Linked List Data Structure in C++ With Illustration
Reverse a Linked List in Groups of Given Size
Reverse Alternate K nodes in a Singly Linked List
When should I use a List vs a LinkedList
Why is deleting in a Singly Linked List O(1)
Construct Full Binary Tree using its Preorder Traversal and Preorder Traversal of its Mirror Tree
Find Relative Complement of two Sorted Arrays
Handshaking Lemma and Interesting Tree Properties -DSA
How to Efficiently Implement kStacks in a Single Array
Write C Functions that Modify Head Pointer of a Linked List
Introduction to Ant Colony Optimization
What is Array
The practical Byzantine Fault Tolerance (pBFT)
Applications of Queue Data Structure
Line Graph
Symmetric Binary Tree
AVL Tree Advantages
AVL Tree Time Complexity
Merge Two Binary Trees
Stack Operations in Data Structure
Self-Balancing Binary Search Trees
Sliding Window Maximum (Maximum of all Subarrays of size K)
AVL Trees Operations
Limitations of Stack in Data Structures
Representation of stack in data structure
Advantages of Threaded Binary Tree
Serialize and Deserialize a Binary Tree
Application of Binary Tree
AVL Tree Applications
B Tree Visualization
Properties of AVL Trees
Push and Pop Operation in Stack in Data Structure
Binary Search Tree Implementation
Find Maximum Sum by Replacing the Subarray in Given Range
Find The Number N, Where (N+X) Divisible By Y And (N-Y) Divisible By X
Find Values of P and Q Satisfying the Equation N = P^2.Q
What is the Balance Factor of AVL Tree
AVL Tree Implementation in Golang
Concatenation of two Linked Lists in O(1) time
Find Minimum Area of Rectangle Formed from Given Shuffled Coordinates
Find the Length of Maximum Path in Given Matrix for Each Index
How to Parse an Array of Objects in C++ Using RapidJson
Largest BST in Binary Tree
How to Print String Literal and Qstring With Qdebug in C++
Properties of Binary Tree
Right View of Binary Tree
Strict Binary Tree
Difference between Comb Sort and Shell Sort
Full Binary Tree
Left View of a Binary Tree
Level order Traversal in a Binary Tree
Lowest Common Ancestor of a Binary Tree
Top View of a Binary Tree
Types of Binary Trees
B Tree Insertion
Evaluation of a Postfix notation
B+ Tree Insertion
Bottom View of a Binary Tree
AVL Tree Program in C
B Tree Applications
B Tree Properties
How to Search, Insert, and Delete in an Unsorted Array
Count Non-Leaf Nodes in a Binary Tree
Get the Level of a Given Key in a Binary Tree
Double Ended Priority Queue
B+ Tree Deletion
B+ Tree Insertion
Hashing in Data Structure
Primitive Data Structure
Find if Binary Tree Satisfies Balanced Height Property
Find the Largest Perfect Binary Tree in a Given Tree
Find Immediate Parents of Two Nodes in a Binary Tree
Applications, Advantages and Disadvantages of Circular Doubly linked List
Sorting Techniques in Data Structures
Find Clockwise Array in Binary Search Tree
Find Duplicate Subtrees in Binary Tree
Find the Index of the Number Using a Binary Tree
Find the In-Order Successor of a Node in a Binary Tree
Reversing a Queue
Different Types of Stack Operations
Time Complexity in Data Structure
Arrays are best Data Structure
Dynamic memory allocation in Data Structure
Application of Data Structure
Applications of Tree in Data Structure
How to Check if a Binary Number is Divisible by 3
Stock Buy and Sell Problem
Find Minimum in Rotated Sorted Array
Interpolation Search vs. Binary Search
Boggle (find all possible words in a board of characters)
Difference Between Prim's and Kruskal's algorithm
Interpolation Search
Quick Sort Using Hoare's Partition

## Find number of Employees Under every ManagerAn employee and his boss are mapped in a dictionary as a number of (employee, manager) pairs, as shown below. Create a function to return the total number of employees, not just their direct reports, that each manager in the hierarchy has. One boss may be presumed to be the only one to whom an employee directly reports. The root node/ceo is listed as reporting to himself in the aforementioned vocabulary. An output dictionary with the following words should be produced. There may be more ways to answer this, but I found it fascinating and thought I'd share: Utilizing memory (Dynamic programming) to determine the number of employees under a management in step 2.b saves us from having to repeat the process for for individual employee. In the code below, the recursive function populateResultUtil() makes use of memoization to prevent re-computation of the same results. ## Code in C++
result = {A=0, B=0, C=2, D=0, E=1, F=5} |

For Videos Join Our Youtube Channel: Join Now

- Send your Feedback to [email protected]

JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.

- Website Designing
- Website Development
- Java Development
- PHP Development
- WordPress
- Graphic Designing
- Logo
- Digital Marketing
- On Page and Off Page SEO
- PPC
- Content Development
- Corporate Training
- Classroom and Online Training
- Data Entry

JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].

Duration: 1 week to 2 week