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
street_type_re = re.compile(r'\b\S+\.?$', re.IGNORECASE) | |
expected = ["Street", "Avenue", "Boulevard", "Drive", "Court", "Place", "Square", "Lane", "Road", | |
"Trail", "Parkway", "Commons"] | |
# UPDATE THIS VARIABLE | |
mapping = { "St": "Street", | |
"St.": "Street", | |
"Ave": "Avenue", |
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
<h1>Ok</h1> | |
Welp |
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
#ifndef __HASH_FAMILY_H__ | |
#define __HASH_FAMILY_H__ | |
class HashFamily { | |
public: | |
// Self-contained Prime numbers | |
enum Prime { | |
A = 54059, | |
B = 76963, | |
C = 68969 |
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
#ifndef __DISTANCE_HEAP_H__ | |
#define __DISTANCE_HEAP_H__ | |
#include "heap.h" | |
#include "node.h" | |
#include <utility> | |
using std::pair; | |
struct DistancePair { |
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 "undirected_graph.h" | |
#include <string> | |
#include <cassert> | |
using std::string; | |
int main() { | |
UndirectedGraph<int> g; | |
g.addVertex(1); | |
g.addVertex(2); |
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
#ifndef __EDGE_H__ | |
#define __EDGE_H__ | |
#include "node.h" | |
struct Edge { | |
Node* from; | |
Node* to; | |
double weight; |
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 "graph_node.h" | |
#include <vector> | |
using std::vector; | |
bool is_connected(vector<GraphNode*> nodes) { | |
for (unsigned i = 0; i < nodes.size(); ++i) { | |
for (unsigned j = 0; j < nodes.size(); ++j) { | |
if (i == j) { | |
continue; |
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
#ifndef __AVL_H__ | |
#define __AVL_H__ | |
#include <iostream> | |
#include <list> | |
#include <algorithm> | |
template<typename T> | |
class Avl { | |
private: |
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 "tree.h" | |
#include <utility> | |
#include <string> | |
using namespace std; | |
struct DictionaryNode { | |
pair<string, string> word_meaning_pair; | |
DictionaryNode(const string& word, const string& meaning) |
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 <vector> | |
#include <algorithm> | |
using namespace std; | |
bool binary_search_rec(const vector<int>& v, unsigned start, unsigned end, int target) { | |
int middle = (start + end) / 2; | |
if (start == end) { | |
return false; |
NewerOlder