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
/* | |
Sign up for YaadCode - Live FreeCode Coamp Coding Sessions Twice Weekly on Skype | |
You may join the FreeCodeCamp, Kingston Group here: https://www.facebook.com/groups/free.code.camp.kingston.jamaica/ | |
https://www.freecodecamp.org/challenges/factorialize-a-number | |
*/ | |
function factorialize(num) { | |
if (num ==1 ){ | |
return 1; | |
} |
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
/* | |
Sign up for YaadCode - Live FreeCode Camp Coding Sessions Twice Weekly on Skype | |
You may join the FreeCodeCamp, Kingston Group here: https://www.facebook.com/groups/free.code.camp.kingston.jamaica/ | |
https://www.freecodecamp.org/challenges/reverse-a-string | |
*/ | |
function reverseString(str) { | |
var chars = str.split(""); | |
chars.reverse(); | |
newStr = chars.join(""); | |
return newStr; |
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
#include<cmath> | |
#include<iostream> | |
#include<climits> | |
using namespace std; | |
int Maximum_Sum_Subarray(int arr[],int n) //Overall Time Complexity O(n) | |
{ | |
int ans = A[0],sum = 0; | |
for(int i = 1;i < n; ++i) //Check if all are negative | |
ans = max(ans,arr[i]); |
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
/* Binary Tree Traversal - Preorder, Inorder, Postorder */ | |
#include<iostream> | |
using namespace std; | |
struct Node { | |
char data; | |
struct Node *left; | |
struct Node *right; | |
}; |