Skip to content

Commit

Permalink
Improved tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
javadev committed Jan 10, 2024
1 parent fe6a6fd commit 2c657aa
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LeetCodeNet/G0001_0100/S0002_add_two_numbers/Solution.cs
Expand Up @@ -6,6 +6,16 @@ namespace LeetCodeNet.G0001_0100.S0002_add_two_numbers {

using LeetCodeNet.Com_github_leetcode;

/**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode() {}
* ListNode(int val) { this.val = val; }
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
* }
*/
public class Solution {
public ListNode AddTwoNumbers(ListNode l1, ListNode l2) {
ListNode dummyHead = new ListNode(0);
Expand Down
Expand Up @@ -6,6 +6,17 @@ namespace LeetCodeNet.G0001_0100.S0019_remove_nth_node_from_end_of_list {

using LeetCodeNet.Com_github_leetcode;

/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int val=0, ListNode next=null) {
* this.val = val;
* this.next = next;
* }
* }
*/
public class Solution {
private int n;

Expand Down
11 changes: 11 additions & 0 deletions LeetCodeNet/G0001_0100/S0021_merge_two_sorted_lists/Solution.cs
Expand Up @@ -7,6 +7,17 @@ namespace LeetCodeNet.G0001_0100.S0021_merge_two_sorted_lists {

using LeetCodeNet.Com_github_leetcode;

/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int val=0, ListNode next=null) {
* this.val = val;
* this.next = next;
* }
* }
*/
public class Solution {
public ListNode MergeTwoLists(ListNode l1, ListNode l2) {
ListNode list = new ListNode(-1);
Expand Down
11 changes: 11 additions & 0 deletions LeetCodeNet/G0001_0100/S0023_merge_k_sorted_lists/Solution.cs
Expand Up @@ -6,6 +6,17 @@ namespace LeetCodeNet.G0001_0100.S0023_merge_k_sorted_lists {

using LeetCodeNet.Com_github_leetcode;

/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int val=0, ListNode next=null) {
* this.val = val;
* this.next = next;
* }
* }
*/
public class Solution {
public ListNode MergeKLists(ListNode[] lists) {
if (lists.Length == 0) {
Expand Down
11 changes: 11 additions & 0 deletions LeetCodeNet/G0001_0100/S0024_swap_nodes_in_pairs/Solution.cs
Expand Up @@ -6,6 +6,17 @@ namespace LeetCodeNet.G0001_0100.S0024_swap_nodes_in_pairs {

using LeetCodeNet.Com_github_leetcode;

/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int val=0, ListNode next=null) {
* this.val = val;
* this.next = next;
* }
* }
*/
public class Solution {
public ListNode SwapPairs(ListNode head) {
if (head == null) {
Expand Down
11 changes: 11 additions & 0 deletions LeetCodeNet/G0001_0100/S0025_reverse_nodes_in_k_group/Solution.cs
Expand Up @@ -6,6 +6,17 @@ namespace LeetCodeNet.G0001_0100.S0025_reverse_nodes_in_k_group {

using LeetCodeNet.Com_github_leetcode;

/**
* Definition for singly-linked list.
* public class ListNode {
* public int val;
* public ListNode next;
* public ListNode(int val=0, ListNode next=null) {
* this.val = val;
* this.next = next;
* }
* }
*/
public class Solution {
public ListNode ReverseKGroup(ListNode head, int k) {
if (head == null || head.next == null || k == 1) {
Expand Down
13 changes: 13 additions & 0 deletions LeetCodeNet/G0501_0600/S0543_diameter_of_binary_tree/Solution.cs
Expand Up @@ -6,6 +6,19 @@ namespace LeetCodeNet.G0501_0600.S0543_diameter_of_binary_tree {

using LeetCodeNet.Com_github_leetcode;

/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int val=0, TreeNode left=null, TreeNode right=null) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
public class Solution {
private int diameter;

Expand Down

0 comments on commit 2c657aa

Please sign in to comment.