随笔分类 - 算法刷题
摘要:经典冒泡排序 冒泡排序算法是一种较为简单的并且稳定的排序算法,该算法的时间复杂度最好为$O(n)$,最差时为$O(n^2)$,需要的空间复杂度为$O(1)$。 算法稳定性:经过排序后,各元素仍然能保持它们在排序之前的相对次序,就称该算法是稳定的,反之,则为不稳定的。 // 经典的冒泡排序是选择从一端
阅读全文
摘要:题干 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes con
阅读全文
摘要:题干 Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answ
阅读全文

浙公网安备 33010602011771号