algorithm - How to use a Linear Search in this particular instance in C#? -
i'm reading text file of dates this
string[] date = system.io.file.readalllines("date.txt");
i converting them this
datetime[] dates = array.convertall(date, s => datetime.parse(s));
how can use linear search search specific date in array can link dates other arrays have? can't them link or output.
i have them sorting in quick sort this
public static void quick_sort<t>(t[] data, int left, int right) t : icomparable<t> { t temp; int i, j; t pivot; = left; j = right; pivot = data[(left + right) / 2]; { while ((data[i].compareto(pivot) < 0) && (i < right)) i++; while ((pivot.compareto(data[j]) < 0) && (j > left)) j--; if (i <= j) { temp = data[i]; data[i] = data[j]; data[j] = temp; i++; j--; } } while (i <= j); if (left < j) quick_sort(data, left, j); if (i < right) quick_sort(data, i, right); }
and have output this
quick_sort(dates, 0, 143); (int = 0; < dates.length; i++) { console.writeline(dates[i].tostring("dd/mm/yyyy")); }
i hope explains want do.
thanks.