Created
March 11, 2018 02:06
-
-
Save dance2die/b1d35b898bb62f577854b10571fc81ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ReverseDemo(List<Order> orders) | |
{ | |
int mid = orders.Count / 2; | |
var leftHalf = orders.Take(mid); | |
var rightHalf = orders.Skip(mid); | |
var combinedOrders = rightHalf.Concat(leftHalf); | |
const int indentyBy = 4; // indent sub result | |
PrintHeaderFooter("Reversing from this list", () => PrintOrders(combinedOrders, indentyBy), indentyBy, '*'); | |
var reversedOrders = combinedOrders.Reverse(); | |
PrintOrders(reversedOrders); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment