Skip to content

Commit

Permalink
Fixing a few function documentations (they were comments before)
Browse files Browse the repository at this point in the history
  • Loading branch information
mina-asham committed May 17, 2015
1 parent dfa52ba commit 7628923
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
8 changes: 7 additions & 1 deletion algs4/algs4/MergeX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ public static void Sort<T>(T[] a) where T : IComparable<T>
Debug.Assert(IsSorted(a));
}

// Sort from a[lo] to a[hi] using insertion Sort
/// <summary>
/// Sort from a[lo] to a[hi] using insertion Sort
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="a"></param>
/// <param name="lo"></param>
/// <param name="hi"></param>
private static void InsertionSort<T>(T[] a, int lo, int hi) where T : IComparable<T>
{
for (int i = lo; i <= hi; i++)
Expand Down
8 changes: 7 additions & 1 deletion algs4/algs4/Quick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ public static void Sort<T>(T[] a) where T : IComparable<T>
Debug.Assert(IsSorted(a));
}

// quicksort the subarray from a[lo] to a[hi]
/// <summary>
/// Quicksort the subarray from a[lo] to a[hi]
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="a"></param>
/// <param name="lo"></param>
/// <param name="hi"></param>
private static void Sort<T>(T[] a, int lo, int hi) where T : IComparable<T>
{
if (hi <= lo)
Expand Down
11 changes: 8 additions & 3 deletions algs4/algs4/SuffixArrayX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace algs4.algs4
public class SuffixArrayX
{
/// <summary>
/// Cutoff to insertion sort (any value between 0 and 12)
/// Cutoff to insertion Sort (any value between 0 and 12)
/// </summary>
private const int Cutoff = 5;

Expand Down Expand Up @@ -49,7 +49,7 @@ public SuffixArrayX(string text)
/// <param name="d"></param>
private void Sort(int lo, int hi, int d)
{
// cutoff to insertion sort for small subarrays
// cutoff to insertion Sort for small subarrays
if (hi <= lo + Cutoff)
{
Insertion(lo, hi, d);
Expand Down Expand Up @@ -184,7 +184,12 @@ public int LCP(int i)
return LCP(_index[i], _index[i - 1]);
}

// longest common prefix of text[i..N) and text[j..N)
/// <summary>
/// Longest common prefix of text[i..N) and text[j..N)
/// </summary>
/// <param name="i"></param>
/// <param name="j"></param>
/// <returns></returns>
private int LCP(int i, int j)
{
int length = 0;
Expand Down

0 comments on commit 7628923

Please sign in to comment.