public override void printLinkedList() { list.Clear(); prev?.stringBackward(); stringForward(); WriteLine(list); }
private void stringBackward() { if (prev != null) { list.Insert(0, $"{data} --> "); prev.stringBackward(); } else { list.Insert(0, $"{data} --> "); } }