随笔分类 - leetcode
摘要:方法一: 1.根据头插法反转链表 public class Solution { public ListNode ReverseList(ListNode head) { ListNode newHead = null; ListNode node = null; while(head != nul
阅读全文
摘要:记录一下常见的排序算法实现: import java.util.Arrays; /** * 常见的排序算法 */ public class SortMain { public static void main(String[] args) { int[] nums = {1, 5, 2, 6, 8,
阅读全文
摘要:/** * 二分搜索算法(包含递归与非递归) */ public class BinarySearch { public static void main(String[] args) { // int[] nums = {1, 3, 5, 6, 8, 9, 11}; // int i = bina
阅读全文

浙公网安备 33010602011771号