You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LeetCode/DataStructures/LinkedList.cs
+59-23Lines changed: 59 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -9,61 +9,75 @@ public class Node
9
9
// Fields
10
10
publicint?Data;
11
11
publicNodeNext;
12
-
publicNodePrevious;
13
12
14
13
// Constructors
14
+
publicNode()
15
+
{
16
+
this.Data=null;
17
+
this.Next=null;
18
+
}
15
19
publicNode(intvalue)
16
20
{
17
21
this.Data=value;
18
22
this.Next=null;
19
-
this.Previous=null;
20
23
}
21
24
}
22
25
23
26
/// <summary>
24
27
/// 707. Design Linked List
25
-
/// Design your implemenation of the linked list. You can choose to use the singly linked list or the doubly lined list. A node in a singly linked list should have two attributes: val and next. Val is the value of the current node, next is a pointer/ reference to the next node. If you want to use the double linked list, you will need one more attribute prev to indicate the previous node in the linked list. Assume all nodes in the linked list are 0-indexed.
28
+
/// Design your implementation of the linked list. You can choose to use the singly linked list or the doubly lined list. A node in a singly linked list should have two attributes: val and next. Val is the value of the current node, next is a pointer/ reference to the next node. If you want to use the double linked list, you will need one more attribute prev to indicate the previous node in the linked list. Assume all nodes in the linked list are 0-indexed.
0 commit comments