This repository serves as a reference for topics learned and explored on leetcode.com
Other great sites to challenge yourself:
Video notes can be found here for most popular problems. Awesome video contant can be found from NeetCode as well.
- Trees
- Graphs
https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/
For/in for Objects:
var person = {
name: "Ben",
surname: "Bundy",
age: 31,
};
var text = "";
var x;
for (x in person) {
text += person[x];
}
For/of for strings and arrays:
var cars = ["Ferrari", "BMW", "Opel", "Mercedes"];
var text = "";
for (let car of cars) {
text += car + "<br>";
}
Depth First Traversals:
- Inorder (Left, Root, Right) : 4 2 5 1 3
- Preorder (Root, Left, Right) : 1 2 4 5 3
- Postorder (Left, Right, Root) : 4 5 2 3 1