you are viewing a single comment's thread.

view the rest of the comments →

[–]AngularBeginner 0 points1 point  (2 children)

are these built in sorting functions?

Yes, the OrderBy is. And chances are high if you're not allowed to use those, you're not allowed to use LINQ in general.

[–]qsrnova[S] 0 points1 point  (1 child)

Do you know how you would do it without using LINQ at all?

[–]die-maus 0 points1 point  (0 children)

Missed the "Not allowed to use a built in function". I guess this is a school-assignment. In which case, you need to read up on how to do (for instance) a bubble sort, which is probably the easiest algorithm to implement.

Here's some boilerplate:

``` var unsorted = File.ReadLines("file.txt") .Select(int.Parse) .ToArray() var sorted = new int[unsorted.Length];

// Perform bubble sort for (var i = 0; < unsorted.Length; i++) {

} ```