8 Node(
int v, Node *n) : val(v), next(n) {}
11int getSize(
Node *root) {
16 return 1 + getSize(root->next);
25void deleteList(
Node *
const root) {
28 deleteList(root->next);
37 for (
int i = 1; i < 10; i++) {
38 temp->next =
new Node(i, NULL);
42 Node *secondList =
new Node(0, NULL);
43 Node *thirdList = NULL;
45 std::cout << getSize(myList) << std::endl
46 << getSize(secondList) << std::endl
47 << getSize(thirdList) << std::endl;
48 deleteList(secondList);