Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

definition of singly linkedlist

# Definition of a singly linked list - C++
struct ListNode {
	int val;	
	ListNode *next;
 	ListNode() : val(0), next(nullptr) {}
  	ListNode(int x) : val(x), next(nullptr) {}
 	ListNode(int x, ListNode *next) : val(x), next(next) {}
};
 
PREVIOUS NEXT
Tagged: #definition #singly #linkedlist
ADD COMMENT
Topic
Name
2+5 =