随笔分类 -  leetcode

摘要:方法一: 1.根据头插法反转链表 public class Solution { public ListNode ReverseList(ListNode head) { ListNode newHead = null; ListNode node = null; while(head != nul 阅读全文
posted @ 2020-10-26 21:57 死磕之路 阅读(100) 评论(0) 推荐(0)
摘要:记录一下常见的排序算法实现: import java.util.Arrays; /** * 常见的排序算法 */ public class SortMain { public static void main(String[] args) { int[] nums = {1, 5, 2, 6, 8, 阅读全文
posted @ 2020-04-19 22:04 死磕之路 阅读(198) 评论(0) 推荐(0)
摘要:/** * 二分搜索算法(包含递归与非递归) */ public class BinarySearch { public static void main(String[] args) { // int[] nums = {1, 3, 5, 6, 8, 9, 11}; // int i = bina 阅读全文
posted @ 2020-04-12 23:20 死磕之路 阅读(1248) 评论(0) 推荐(0)