|
2 | 2 |
|
3 | 3 | - [Important thing to remember](#important-thing-to-remember) |
4 | 4 | - [Working with this repo](#working-with-this-repo) |
| 5 | +- [All Coding interview exercise and answers](#all-coding-interview-exercise-and-answers) |
5 | 6 | - [What to practice?](#what-to-practice) |
6 | 7 | - [How to Approach?](#how-to-approach) |
7 | 8 | - [Before you code](#before-you-code) |
|
63 | 64 | - [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) |
64 | 65 | - [Recursion Interview Questions](#recursion-interview-questions) |
65 | 66 | - [Calculate x to the power n using recursion](#calculate-x-to-the-power-n-using-recursion) |
| 67 | + - [Calculate Modular Exponentiation using recursion](#calculate-modular-exponentiation-using-recursion) |
66 | 68 | - [References](#references) |
67 | 69 |
|
68 | 70 | ## Important thing to remember |
|
78 | 80 | - Then run individual file to see result on console. |
79 | 81 | - You should use `node filename` in console to see results. |
80 | 82 |
|
| 83 | + ## All Coding interview exercise and answers |
| 84 | + |
| 85 | + [View all of the coding exercises and answers](https://codepen.io/collection/VYvwJN?grid_type=list) |
| 86 | + |
81 | 87 | ## What to practice? |
82 | 88 |
|
83 | 89 | 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). |
@@ -139,7 +145,7 @@ Learn Big O. Make sure you give what would be the `runtime complexity` and `memo |
139 | 145 |  |
140 | 146 |
|
141 | 147 | **Recursive Factorial Space complexity is O(n)** |
142 | | - |
| 148 | + |
143 | 149 |  |
144 | 150 |
|
145 | 151 | ## Data Structures |
@@ -628,25 +634,30 @@ abstract data type (ADT) - ADT is defined as a user point of view of a data type |
628 | 634 |
|
629 | 635 | [Answer for Creating Minimal Tree Interview Question](src/interview-questions/graph/2-minimal-bs-tree.mjs) |
630 | 636 |
|
631 | | - |
632 | 637 | ### Recursion Interview Questions |
633 | 638 |
|
634 | 639 | #### Calculate x to the power n using recursion |
635 | 640 |
|
636 | | -**x to the power n Brute Force** |
| 641 | +**x to the power n Brute Force** |
637 | 642 |
|
638 | 643 |  |
639 | 644 |
|
640 | | - |
641 | | -**x to the power n using simple recursion un-optimized** |
| 645 | +**x to the power n using simple recursion un-optimized** |
642 | 646 |
|
643 | 647 |  |
644 | 648 |
|
645 | | - |
646 | | -**x to the power n using optimized recursion with multiple subproblems** |
| 649 | +**x to the power n using optimized recursion with multiple subproblems** |
647 | 650 |
|
648 | 651 |  |
649 | 652 |
|
| 653 | +#### Calculate Modular Exponentiation using recursion |
| 654 | + |
| 655 | +Modular Exponentiation is the remainder dividing up on `Pow(x,n)` by `M`. |
| 656 | + |
| 657 | + |
| 658 | + |
| 659 | +- [Question](https://codepen.io/roopkt/pen/XWMxvKg?editors=0010) |
| 660 | +- [Answer](https://codepen.io/roopkt/pen/oNZaKLy?editors=0010) |
650 | 661 |
|
651 | 662 | ## References |
652 | 663 |
|
|
0 commit comments