tests/java/src/reverseLinkedList/ListNode.java
public static String listToString(ListNode head) {
		if (head == null) {
			return "";
		}
		StringBuilder sb = new StringBuilder();
		while (head.next != null) {
			sb.append(head.val).append(",");
			head = head.next;
		}
		sb.append(head.val);
		return sb.toString();
	}
/**
	 * This is an assistant function, use it, we can easily see the structure of list
	 */
This is an assistant function, use it, we can easily see the structure of list
This is an assistant function use it we can easily see the structure of list
public static String listToString(ListNode head) {
		if (head == null) {
			return "";
		}
		StringBuilder sb = new StringBuilder();
		while (head.next != null) {
			sb.append(head.val).append(",");
			head = head.next;
		}
		sb.append(head.val);
		return sb.toString();
	}
public static String listToString ( ListNode head ) { if ( head == null ) { return "" ; } StringBuilder sb = new StringBuilder ( ) ; while ( head . next != null ) { sb . append ( head . val ) . append ( "," ) ; head = head . next ; } sb . append ( head . val ) ; return sb . toString ( ) ; }
This is an assistant function, use it, we can easily see the structure of list
This is an assistant function use it we can easily see the structure of list