Created
February 27, 2021 04:48
-
-
Save eengineergz/5dec7e3736d7b5e28a5f1c85b5b50705 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// O(2^n) | |
function exponential2n(n) { | |
if (n === 1) return; | |
exponential_2n(n - 1); | |
exponential_2n(n - 1); | |
} | |
// O(3^n) | |
function exponential3n(n) { | |
if (n === 0) return; | |
exponential_3n(n - 1); | |
exponential_3n(n - 1); | |
exponential_3n(n - 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment