We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Insert a node at the head of a linked list
Insert a node at the head of a linked list
Sort by
recency
|
978 Discussions
|
Please Login in order to post a comment
What others already mentioned. C#'s main has code copy-pasta from C++ and is not a valid C# code, so can't build in C#.
So much for hacker ranking and leet coding :lol:
Here is my c++ solution you watch vide explanation here : https://youtu.be/COnfpdhOlN8
SinglyLinkedListNode* insertNodeAtHead(SinglyLinkedListNode* head, int val) { SinglyLinkedListNode* temp = new SinglyLinkedListNode(val); temp->next = head; return temp; }
c# Main() method is broken, cannot fix it it is locked for editing.
The c# method has error here :: PrintSinglyLinkedList(llist->head, "\n", textWriter);
The -> operator is not allowed c# (pointer only for c/c++).
Use another compiler.