Skip to content

Commit 7c6ce29

Browse files
committed
chore recursive binary search
1 parent 4c9ab07 commit 7c6ce29

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
[Visit this page in Website for Coding interview](http://www.rupeshtiwari.com/coding-examples-cs-fundamentals/)
2-
1+
[Visit this page in Website for Coding interview](http://www.rupeshtiwari.com/coding-examples-cs-fundamentals/)
32

43
- [Important thing to remember](#important-thing-to-remember)
54
- [Working with this repo](#working-with-this-repo)
@@ -354,7 +353,7 @@ A binary tree is a type of tree in which each node has `at most two children` (0
354353

355354
#### Minimal Binary Tree
356355

357-
A Minimal Binary Tree has about the same number of nodes on the left of each node as on the right.
356+
A Minimal Binary Tree has about the same number of nodes on the left of each node as on the right.
358357

359358
#### Binary Search Tree (BST)
360359

@@ -376,19 +375,25 @@ Below image showing how to add `[3, 7, 4, 6, 5, 1, 10, 2, 9, 8]` in BST.
376375
- [Binary Search Tree Implementation Question](https://codepen.io/roopkt/pen/RwpJBOw?editors=0010)
377376
- [Binary Search Tree Implementation Answer](https://codepen.io/roopkt/pen/LYWBYMM?editors=0010)
378377

379-
380378
Binary Search can be done both in iterative or recursive way.
381379

382-
![](https://i.imgur.com/Qu4YQk3.png)
380+
![](https://i.imgur.com/PWjbCaZ.png)
383381

384382
#### Binary Search Iterative
385383

386384
![](https://i.imgur.com/CQSDjqZ.png)
387385

388-
#### Binary Search Recursive
386+
#### Binary Search Recursive
387+
388+
![](https://i.imgur.com/h2azawY.png)
389+
390+
Simulating Recursive Binary Search for an existing number in a sorted increasing order unique integer array.
389391

390-
![](https://i.imgur.com/gn7mwvR.png)
392+
![](https://i.imgur.com/gSRARcL.png)
391393

394+
Simulating Recursive Binary Search for an non-existing number in a sorted increasing order unique integer array.
395+
396+
![](https://i.imgur.com/wC7TAsu.png)
392397

393398
### Trie
394399

@@ -561,9 +566,7 @@ abstract data type (ADT) - ADT is defined as a user point of view of a data type
561566

562567
![](https://i.imgur.com/JAYs7el.png)
563568

564-
565-
566-
#### 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.
567570

568571
## References
569572

0 commit comments

Comments
 (0)