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.
Currently, the C# version cannot compile even if you try to simply return the passed in llist parameter:
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(34,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(24,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(35,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(33,16): warning CS8618: Non-nullable field 'head' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(25,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(22,16): warning CS8618: Non-nullable field 'next' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(33,16): warning CS8618: Non-nullable field 'tail' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(22,16): warning CS8618: Non-nullable field 'prev' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(91,9): error CS0246: The type or namespace name 'reutrn' could not be found (are you missing a using directive or an assembly reference?) [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(91,16): error CS0136: A local or parameter named 'llist' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(91,16): warning CS0168: The variable 'llist' is declared but never used [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(89,40): error CS0161: 'Solution.Result.sortedInsert(Solution.DoublyLinkedListNode, int)': not all code paths return a value [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(114,43): error CS0103: The name 'sortedInsert' does not exist in the current context [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(98,50): warning CS8604: Possible null reference argument for parameter 'path' in 'StreamWriter.StreamWriter(string path, bool append)'. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Inserting a Node Into a Sorted Doubly Linked List
You are viewing a single comment's thread. Return to all comments →
Currently, the C# version cannot compile even if you try to simply return the passed in llist parameter:
/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(34,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(24,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(35,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(33,16): warning CS8618: Non-nullable field 'head' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(25,25): warning CS8625: Cannot convert null literal to non-nullable reference type. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(22,16): warning CS8618: Non-nullable field 'next' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(33,16): warning CS8618: Non-nullable field 'tail' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(22,16): warning CS8618: Non-nullable field 'prev' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(91,9): error CS0246: The type or namespace name 'reutrn' could not be found (are you missing a using directive or an assembly reference?) [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(91,16): error CS0136: A local or parameter named 'llist' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(91,16): warning CS0168: The variable 'llist' is declared but never used [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(89,40): error CS0161: 'Solution.Result.sortedInsert(Solution.DoublyLinkedListNode, int)': not all code paths return a value [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(114,43): error CS0103: The name 'sortedInsert' does not exist in the current context [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj] /tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.cs(98,50): warning CS8604: Possible null reference argument for parameter 'path' in 'StreamWriter.StreamWriter(string path, bool append)'. [/tmp/submission/20240608/23/15/hackerrank-1d3be4ba9bd433a26ff4c02e562558ff/code/Solution.csproj]