Merge branch 'my-algo-contribution' of https://github.com/weiss-ben/C-Plus-Plus into my-algo-contribution

This commit is contained in:
weiss-ben 2022-09-15 20:34:19 +03:00
commit a59540e493

View File

@ -21,11 +21,11 @@
* Definition for singly-linked list. * Definition for singly-linked list.
*/ */
struct ListNode { struct ListNode {
int val; // The value stored in the node int val; ///< the value stored in the node
ListNode *next; // Pointer to the next node ListNode *next; ///< pointer to the next node
ListNode() : val(0), next(nullptr) {} // Default constructor ListNode() : val(0), next(nullptr) {} ///< default constructor
ListNode(int x) : val(x), next(nullptr) {} // Constructor with value for node->val provided ListNode(int x) : val(x), next(nullptr) {} ///< constructor with value for node->val provided
ListNode(int x, ListNode *next) : val(x), next(next) {} // Constructor with values provided for node->val and node->next ListNode(int x, ListNode *next) : val(x), next(next) {} ///< constructor with values provided for node->val and node->next
}; };
#include <iostream> /// for IO operations #include <iostream> /// for IO operations