Skip to content

Commit 508dc71

Browse files
committed
Merge pull request xtaci#45 from tmdrnjs54/master
I have modified some misspellings!
2 parents 50035c9 + 20ecf38 commit 508dc71

9 files changed

+14
-14
lines changed

include/binary_search_tree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace alg {
3131
class BST {
3232
private:
3333
/**
34-
* binary search tree definiton.
34+
* binary search tree definition.
3535
*/
3636
struct treeNode {
3737
KeyT key; // key

include/dijkstra.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace alg {
5252
// all vertices
5353
Graph::Adjacent * a;
5454
list_for_each_entry(a, &g.list(), a_node){
55-
dist[a->v.id] = LARGE_NUMBER; // set inital distance to each vertex to a large number
55+
dist[a->v.id] = LARGE_NUMBER; // set initial distance to each vertex to a large number
5656
(*previous)[a->v.id] = UNDEFINED; // clear path to UNDEFINED
5757
visited[a->v.id] = false; // all vertices are not visited
5858
Q.push(LARGE_NUMBER, a->v.id); // push all vertices to heap

include/hash_table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace alg {
3636
typedef _HashCode hash_code_fn;
3737
private:
3838
/**
39-
* definiton of Key-Value pair.
39+
* definition of Key-Value pair.
4040
*/
4141
struct HashKV {
4242
key_type key; // 32-bit key

include/merge_sort.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* and right part.
1414
* Example: Say the input is -10 32 45 -78 91 1 0 -16 then the left part will be
1515
* -10 32 45 -78 and the right part will be 91 1 0 6.
16-
* (2) Sort Each of them seperately. Note that here sort does not mean to sort it using some other
17-
* method. We already wrote fucntion to sort it. Use the same.
16+
* (2) Sort Each of them separately. Note that here sort does not mean to sort it using some other
17+
* method. We already wrote function to sort it. Use the same.
1818
* (3) Then merge the two sorted parts.
1919
*
2020
* ------------

include/priority_queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace alg {
7575
list_add(&n->node, &m_head);
7676
m_count++;
7777
} else {
78-
// sequentially find the apropriate position
78+
// sequentially find the appropriate position
7979
PQNode * pos;
8080
bool found = false;
8181
list_for_each_entry(pos, &m_head, node) {

include/skiplist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace alg {
9797
if(x == NULL || x->key != key) {
9898
int lvl = random_level(); // random promotion
9999

100-
// for nodes higer than current max level
100+
// for nodes higher than current max level
101101
// make 'header node' as it's prev
102102
if(lvl > m_level) {
103103
for(int i = m_level + 1; i <= lvl; i++) {

include/suffix_tree.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SuffixTree
2424
SuffixTree(string str):test_str(str), root(test_str), active_point(&root, 0, 0), remainder(0), pos(0), active_e(0), ls() {}
2525
int construct(void);
2626

27-
// return -1 if no such sub exist, return the beginning postion of this substring in thr original string if it exist
27+
// return -1 if no such sub exist, return the beginning position of this substring in thr original string if it exist
2828
int search(string sub);
2929

3030
// return the length of the longest prefix of sub which can be matched in suffix tree
@@ -257,7 +257,7 @@ class SuffixTree
257257
int remainder;
258258
// how many characters inserted?
259259
unsigned int pos;
260-
unsigned int active_e; // the beginnig position of suffixes need to be inserted
260+
unsigned int active_e; // the beginning position of suffixes need to be inserted
261261
char get_ele(int i) { return test_str[i]; }
262262
// insert a char from pos to suffix tree
263263
int insert();
@@ -266,7 +266,7 @@ class SuffixTree
266266
int print_node(Node* node, int level);
267267

268268

269-
Node* seperate_edge(Node * node, Edge* edge);
269+
Node* separate_edge(Node * node, Edge* edge);
270270

271271
// check if we can change active node
272272
bool check_active_node(void)

include/universal_hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace alg {
6363
}
6464

6565
/**
66-
* hash an arbitary length integer.
66+
* hash an arbitrary length integer.
6767
* len, number of 32-bit integer, max len is 32
6868
*/
6969
static uint32_t uhash_bigint(const struct UHash * params, uint32_t * key, uint32_t len) {

src/suffix_tree_demo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int SuffixTree::construct(void)
8282
ls.ins_link(node);
8383
break;
8484
}
85-
Node *newnode = seperate_edge(node, a_edge);
85+
Node *newnode = separate_edge(node, a_edge);
8686
Edge* newedge = new Edge(pos, numeric_limits<unsigned int>::max(), test_str);
8787
newnode->add_edge(newedge);
8888
ls.ins_link(newnode);
@@ -106,7 +106,7 @@ int SuffixTree::construct(void)
106106

107107
SuffixTree::Node* SuffixTree::seperate_edge(Node * node, Edge* a_edge)
108108
{
109-
cout << "seperate the old edge here: " << (*a_edge) << endl;
109+
cout << "separate the old edge here: " << (*a_edge) << endl;
110110
int new_begin = a_edge->begin + get_active_length();
111111
int new_end = a_edge->end;
112112

@@ -175,7 +175,7 @@ using namespace std;
175175

176176
int main()
177177
{
178-
cout << "Begining" << endl;
178+
cout << "Beginning" << endl;
179179
SuffixTree st("mississippi");
180180

181181
cout << "Constructing..." << endl;

0 commit comments

Comments
 (0)