Insert a node at a specific position in a linked list

  • + 0 comments

    For C# csharp you cannot compile as given.

    class Result
    {
        public static SinglyLinkedListNode insertNodeAtPosition(...)
        {
    		...
        }
    }
    

    You need to modify the above code by removing class Result{} block and remove the public modifer on the method.

    You should be left with...

        static SinglyLinkedListNode insertNodeAtPosition(...)
        {
    		...
        }
    

    This should allow your code to compile.