|
63 | 63 | - [Trees and Graphs](#trees-and-graphs)
|
64 | 64 | - [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)
|
65 | 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)
|
| 66 | + - [Check if a given binary tree is BST ( Binary Search Tree )](#check-if-a-given-binary-tree-is-bst--binary-search-tree-) |
66 | 67 | - [Recursion Interview Questions](#recursion-interview-questions)
|
67 | 68 | - [Calculate x to the power n using recursion](#calculate-x-to-the-power-n-using-recursion)
|
68 | 69 | - [Calculate Modular Exponentiation using recursion](#calculate-modular-exponentiation-using-recursion)
|
@@ -646,6 +647,13 @@ Trade off or invest some memory to improve run time complexity. Suppose use Has-
|
646 | 647 |
|
647 | 648 | [Answer for Creating Minimal Tree Interview Question](src/interview-questions/graph/2-minimal-bs-tree.mjs)
|
648 | 649 |
|
| 650 | + |
| 651 | +#### Check if a given binary tree is BST ( Binary Search Tree ) |
| 652 | + |
| 653 | +**Binary Search Tree (BST)**: is a binary tree in which for each node value of all the nodes in the left subtree is lesser or equal to the root node. And the values of all the nodes in the right subtree is greater than the root node. |
| 654 | + |
| 655 | + |
| 656 | + |
649 | 657 | ### Recursion Interview Questions
|
650 | 658 |
|
651 | 659 | #### Calculate x to the power n using recursion
|
@@ -722,7 +730,18 @@ Try `Binary Search`.
|
722 | 730 |
|
723 | 731 | #### Reverse linked list
|
724 | 732 |
|
| 733 | + |
| 734 | + |
| 735 | +Algorithm of Reverse Linked List: |
| 736 | + |
| 737 | + |
| 738 | + |
| 739 | +Reverse Linked List simulation: |
| 740 | + |
| 741 | + |
725 | 742 |
|
| 743 | +- [Question](https://codepen.io/roopkt/pen/mdWayxv?editors=0010) |
| 744 | +- [Answer](https://codepen.io/roopkt/pen/dyvwPej?editors=0011) |
726 | 745 |
|
727 | 746 | ## References
|
728 | 747 |
|
|
0 commit comments