This file contains hidden or 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
// xhttps://www.youtube.com/watch?v=VOQNf1VxU3Q&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=14&t=0s | |
#include <iostream> | |
struct Node { | |
int value; | |
Node* prev; | |
Node* next; | |
Node(int x): prev(nullptr), next(nullptr) | |
{ |
This file contains hidden or 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
// https://www.youtube.com/watch?v=dolcMgiJ7I0&list=PL2_aWCzGMAwLL-mEB4ef20f3iqWMGWa25&index=6&t=0s | |
#include <iostream> | |
#include <list> | |
#include <cmath> | |
// Big O(sqrt(n)) | |
std::list<int> getFactors(int n) { | |
std::list<int> factors; | |
for (int i = 1; i <= sqrt(n); i++) { |
This file contains hidden or 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
// https://www.youtube.com/watch?v=LW8Rfh6TzGg&list=PL2_aWCzGMAwLZp6LMUKI3cc7pgGsasm2_&index=5 | |
#include <iostream> | |
void helloWorld() { | |
std::cout << "Hello world" << std::endl; | |
}; | |
void myFunction(void (*callback)()) { | |
callback(); |
This file contains hidden or 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
// https://www.youtube.com/watch?v=LW8Rfh6TzGg&list=PL2_aWCzGMAwLZp6LMUKI3cc7pgGsasm2_&index=5 | |
#include <iostream> | |
int add(int a, int b) { | |
return a + b; | |
} | |
int main() { | |
This file contains hidden or 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
// https://www.youtube.com/watch?v=vcQIFT79_50&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=6&t=0s | |
#include <iostream> | |
struct Node { | |
int value; | |
Node* next; | |
}; | |
class LinkedList { |
This file contains hidden or 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
// https://www.youtube.com/watch?v=7HCd074v8g8&list=PL2_aWCzGMAwLL-mEB4ef20f3iqWMGWa25&index=8&t=0s | |
#include <iostream> | |
#include <list> | |
#include <cmath> | |
int brutDivision(int a, int b) { | |
int gcd = 1; | |
std::list<int> factors; | |
for (int i = 2; i < sqrt(a); i++) { |
This file contains hidden or 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
// https://www.youtube.com/watch?v=ijIxcB9qjaU&list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb&index=32 | |
#include <iostream> | |
class String { | |
private: | |
char* m_Buffer; | |
unsigned int m_Size; | |
public: | |
String(const char* string) { |
This file contains hidden or 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
// https://www.youtube.com/watch?v=6PDtgHhpCHo&list=PL2_aWCzGMAwLL-mEB4ef20f3iqWMGWa25&index=7&t=0s | |
#include <iostream> | |
#include <list> | |
#include <cmath> | |
std::list<int> getPrimeFactors(int n) { | |
std::list<int> factors; | |
int times = n; | |
// Optimization to BIG O(sqrt(n)) |
This file contains hidden or 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 <string> | |
#include <stack> | |
bool isOperator(char x) { | |
if (x == '+' || x == '-' || x == '*' || x == '/' ) | |
return true; | |
return false; | |
} |