Format the Java codes with the Reat Hat extension.

This commit is contained in:
krahets
2023-04-14 00:12:10 +08:00
parent 7273ee24e8
commit f8513455b5
39 changed files with 195 additions and 205 deletions

View File

@ -6,9 +6,7 @@
package include;
/**
* Definition for a singly-linked list node
*/
/* Definition for a singly-linked list node */
public class ListNode {
public int val;
public ListNode next;
@ -16,12 +14,8 @@ public class ListNode {
public ListNode(int x) {
val = x;
}
/**
* Generate a linked list with an array
* @param arr
* @return
*/
/* Generate a linked list with an array */
public static ListNode arrToLinkedList(int[] arr) {
ListNode dum = new ListNode(0);
ListNode head = dum;
@ -32,12 +26,7 @@ public class ListNode {
return dum.next;
}
/**
* Get a list node with specific value from a linked list
* @param head
* @param val
* @return
*/
/* Get a list node with specific value from a linked list */
public static ListNode getListNode(ListNode head, int val) {
while (head != null && head.val != val) {
head = head.next;