Skip to content

Commit eff500c

Browse files
committed
chore: minimal tree
1 parent 4b2d3e9 commit eff500c

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

README.md

+16-11
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
- [Find Median Values (With Merge Sort Algorithm)](#find-median-values-with-merge-sort-algorithm)
5252
- [Quick Sort](#quick-sort)
5353
- [Quick Sort Implementation](#quick-sort-implementation)
54-
- [BFS (Breath First Search)](#bfs-breath-first-search)
5554
- [Math & Stats](#math--stats)
5655
- [Integer Division Without Using \* or /](#integer-division-without-using--or-)
5756
- [Array slice](#array-slice)
@@ -63,7 +62,7 @@
6362
- [Interview Questions Easy](#interview-questions-easy)
6463
- [Trees and Graphs](#trees-and-graphs)
6564
- [Route Between Nodes: Given a directed graph, design an algorithm to find out whether there is a route between two nodes.](#route-between-nodes-given-a-directed-graph-design-an-algorithm-to-find-out-whether-there-is-a-route-between-two-nodes)
66-
- [Minimal Tree: Given a sorted increasing order array with unique integer elements, write an algorithm to create a binary search tree with minimal height.](#minimal-tree-given-a-sorted-increasing-order-array-with-unique-integer-elements-write-an-algorithm-to-create-a-binary-search-tree-with-minimal-height)
65+
- [Minimal Tree: Given a sorted increasing order array with unique integer elements, write an algorithm to create a binary search tree with minimal height](#minimal-tree-given-a-sorted-increasing-order-array-with-unique-integer-elements-write-an-algorithm-to-create-a-binary-search-tree-with-minimal-height)
6766
- [References](#references)
6867

6968
## Important thing to remember
@@ -74,13 +73,11 @@
7473

7574
## Working with this repo
7675

77-
- Download or clone in local machine.
76+
- Download or clone in local machine.
7877
- Run `npm ci`
7978
- Then run individual file to see result on console.
8079
- You should use `node filename` in console to see results.
8180

82-
83-
8481
## What to practice?
8582

8683
Make sure you know Computer science [basic data structures](#data-structures-you-should-know). Also you should be aware of [fundamental algorithms](#fundamental-algorithms-you-should-know).
@@ -435,8 +432,8 @@ Graph represents network. It has Nodes, Vertices and Edges.
435432

436433
![ ](https://i.imgur.com/eqzKDIV.png)
437434

438-
[Question](https://codepen.io/roopkt/pen/ZEejLJe?editors=0010)
439-
[Answer](https://codepen.io/roopkt/pen/vYxagrP?editors=0010)
435+
[Implement Graph Question](https://codepen.io/roopkt/pen/ZEejLJe?editors=0010)
436+
[Implement Graph Answer](https://codepen.io/roopkt/pen/vYxagrP?editors=0010)
440437

441438
#### Breadth First Search (BFS)
442439

@@ -484,7 +481,7 @@ Merge Sort Implementation Visualization:
484481

485482
So in order to find median we can use the stich algorithm since arrays are already sorted. Then we can find the middle index.
486483

487-
[Question File](src/sorting/merge-sort/find-median-values.mjs)
484+
[Find Median Values Question & Answer](src/sorting/merge-sort/find-median-values.mjs)
488485

489486
### Quick Sort
490487

@@ -497,8 +494,6 @@ When Browser's are not using Merge sort they most of the time use Quick sort var
497494
- [Implement Quick Sort Question](https://codepen.io/roopkt/pen/NWpzMRv?editors=0010)
498495
- [Implement Quick Sort Answer](https://codepen.io/roopkt/pen/eYvKrvP?editors=0010)
499496

500-
### BFS (Breath First Search)
501-
502497
## Math & Stats
503498

504499
### Integer Division Without Using \* or /
@@ -571,7 +566,17 @@ abstract data type (ADT) - ADT is defined as a user point of view of a data type
571566

572567
![](https://i.imgur.com/JAYs7el.png)
573568

574-
#### Minimal Tree: Given a sorted increasing order array with unique integer elements, write an algorithm to create a binary search tree with minimal height.
569+
#### Minimal Tree: Given a sorted increasing order array with unique integer elements, write an algorithm to create a binary search tree with minimal height
570+
571+
**What is Minimal Tree?**
572+
573+
![](https://i.imgur.com/9wkzVyk.png)
574+
575+
**Minimal Tree Simulation**
576+
577+
![](https://i.imgur.com/scpMVbO.png)
578+
579+
[Answer for Creating Minimal Tree Interview Question](src/interview-questions/graph/2-minimal-bs-tree.mjs)
575580

576581
## References
577582

0 commit comments

Comments
 (0)