随笔分类 - leetcode_sort
摘要:Sort a linked list in O(n log n) time using constant space complexity. 含义:为一个列表排序,要求空间复杂度为常量 思路:使用归并排序 1 public class Solution { 2 public ListNode sor
阅读全文
摘要:Sort a linked list using insertion sort. 含义:用插入排序来对列表进行排序 思路:可以构建一个临时的链表,然后将待排序的链表的每一个节点插入到临时链表中 // 插入排序 public ListNode insertionSortList(ListNode he
阅读全文
摘要:Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string.
阅读全文
摘要:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According
阅读全文