Skip to content

Commit

Permalink
Fixing naming inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
mina-asham committed May 17, 2015
1 parent 1ef9517 commit 4286332
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions algs4/algs4/TrieST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ public IEnumerable<string> KeysWithPrefix(string prefix)
{
Queue<string> results = new Queue<string>();
Node x = Get(_root, prefix, 0);
collect(x, new StringBuilder(prefix), results);
Collect(x, new StringBuilder(prefix), results);
return results;
}

private void collect(Node x, StringBuilder prefix, Queue<string> results)
private void Collect(Node x, StringBuilder prefix, Queue<string> results)
{
if (x == null)
{
Expand All @@ -163,7 +163,7 @@ private void collect(Node x, StringBuilder prefix, Queue<string> results)
for (char c = (char)0; c < R; c++)
{
prefix.Append(c);
collect(x.Next[c], prefix, results);
Collect(x.Next[c], prefix, results);
prefix.Remove(prefix.Length - 1, 1);
}
}
Expand All @@ -178,11 +178,11 @@ private void collect(Node x, StringBuilder prefix, Queue<string> results)
public IEnumerable<string> KeysThatMatch(string pattern)
{
Queue<string> results = new Queue<string>();
collect(_root, new StringBuilder(), pattern, results);
Collect(_root, new StringBuilder(), pattern, results);
return results;
}

private void collect(Node x, StringBuilder prefix, string pattern, Queue<string> results)
private void Collect(Node x, StringBuilder prefix, string pattern, Queue<string> results)
{
if (x == null)
{
Expand All @@ -203,14 +203,14 @@ private void collect(Node x, StringBuilder prefix, string pattern, Queue<string>
for (char ch = (char)0; ch < R; ch++)
{
prefix.Append(ch);
collect(x.Next[ch], prefix, pattern, results);
Collect(x.Next[ch], prefix, pattern, results);
prefix.Remove(prefix.Length - 1, 1);
}
}
else
{
prefix.Append(c);
collect(x.Next[c], prefix, pattern, results);
Collect(x.Next[c], prefix, pattern, results);
prefix.Remove(prefix.Length - 1, 1);
}
}
Expand Down

0 comments on commit 4286332

Please sign in to comment.