File tree Expand file tree Collapse file tree 2 files changed +23
-22
lines changed
src/algorithm_exercises_csharp/hackerrank/interview_preparation_kit/linked_list/lib Expand file tree Collapse file tree 2 files changed +23
-22
lines changed Original file line number Diff line number Diff line change 1+ namespace algorithm_exercises_csharp . hackerrank . interview_preparation_kit . linked_list . lib ;
2+
3+ public static class LinkedListPrinter
4+ {
5+ public static void printSinglyLinkedList < T > ( LinkedList < T > . Node ? node , string sep , TextWriter textWriter )
6+ {
7+ var pointTo = node ;
8+
9+ while ( pointTo != null )
10+ {
11+ ArgumentNullException . ThrowIfNull ( textWriter ) ;
12+
13+ textWriter . Write ( pointTo . data ) ;
14+
15+ pointTo = pointTo . next ;
16+
17+ if ( pointTo != null )
18+ {
19+ textWriter . Write ( sep ) ;
20+ }
21+ }
22+ }
23+ }
Original file line number Diff line number Diff line change 11namespace algorithm_exercises_csharp . hackerrank . interview_preparation_kit . linked_list . lib ;
22
3- public static class LinkedListPrinter
4- {
5- public static void printSinglyLinkedList < T > ( LinkedList < T > . Node ? node , string sep , TextWriter textWriter )
6- {
7- var pointTo = node ;
8-
9- while ( pointTo != null )
10- {
11- ArgumentNullException . ThrowIfNull ( textWriter ) ;
12-
13- textWriter . Write ( pointTo . data ) ;
14-
15- pointTo = pointTo . next ;
16-
17- if ( pointTo != null )
18- {
19- textWriter . Write ( sep ) ;
20- }
21- }
22- }
23- }
24-
253public static class LinkedList < T >
264{
275 public class Node ( T nodeData )
You can’t perform that action at this time.
0 commit comments