Like 1-off, something like:
var el = list.Last; while (el != null) {
If you do this regularly, perhaps a similar iterator block to get all the values:
public static IEnumerable<T> Reverse<T>(this LinkedList<T> list) { var el = list.Last; while (el != null) { yield return el.Value; el = el.Previous; } }
then
foreach(var val in list.Reverse()) {
Marc gravell
source share