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 <vector> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
vector<int> distribution_counting_sort(vector<int> &array) { | |
int min_value = *min_element(array.begin(), array.end()); | |
int max_value = *max_element(array.begin(), array.end()); |
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 "hash_table.h" | |
HashTable::HashTable() : table(16) {} | |
HashTable::HashTable(int size) : table(size) { | |
} | |
HashTable::~HashTable() = default; |
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 <vector> | |
#include <utility> | |
#include <functional> | |
using namespace std; | |
int knapsack_problem(vector<pair<int, int>> &items, int capacity) { | |
function<int(vector<pair<int, int>> &, int, int)> recursion; | |
recursion = [&](vector<pair<int, int>> &items, int i, int j) -> int { |
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 "polynomial.h" | |
using namespace std; | |
int main() { | |
{ | |
cout << Polynomial {} << endl; | |
cout << (Polynomial) {-3} << endl; | |
cout << (Polynomial) {-2, 3} << endl; |
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 <vector> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
template<typename T> | |
vector<T> comparison_counting_sort(vector<T> &array, function<bool(T, T)> key_func) { |
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 <bitset> | |
#include <vector> | |
#include <cassert> | |
using namespace std; | |
template<size_t bitset_size> | |
int robot_coin_collection(vector<bitset<bitset_size>> &coin_matrix) { |
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 <utility> | |
#include <algorithm> | |
#include <list> | |
#include <iostream> | |
#include <map> | |
#include <stdexcept> | |
#include <vector> | |
#include <functional> | |
#include <queue> |
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 <algorithm> | |
#include <unordered_map> | |
using namespace std; | |
bool is_anagram(const string &str_a, const string &str_b) | |
{ | |
unordered_map<char, int> chars_occurrences; |
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 <vector> | |
#include <algorithm> | |
#include <math.h> | |
#include <numeric> | |
using namespace std; | |
typedef struct Point_ | |
{ |
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 <stack> | |
#include <regex> | |
using namespace std; | |
void print_tags(string text); | |
bool is_start_tag(const string &element); |
NewerOlder