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 <iostream> | |
#include <stdlib.h> | |
#include <string> | |
using namespace std; | |
/* | |
[solution] | |
1.we can create a boolean arrary with size of 256 since there are | |
256 ascii character in total. |
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 <iostream> | |
#include <stdlib.h> | |
#include <string> | |
using namespace std; | |
/* | |
[question] | |
1.3 Given two strings, write a method to decide if one is a permutation of the other. |
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 <iostream> | |
#include <stdlib.h> | |
#include <string> | |
using namespace std; | |
/* | |
[question] | |
1.2 Implement a function void reverse(char* str) in C or C++ which reverses a nullterminated string. |
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 <iostream> | |
#include <stdlib.h> | |
#include <string> | |
using namespace std; | |
/* | |
[question] | |