2016年5月20日

指针实现时间复杂度为O(n*logN)的排序算法(归并排序算法)

摘要: 归并排序 实现过程 归并排序算法: 1、首先将链表进行切分。在我们的算法中,使用两个指针fast和slow,fast的遍历速度是slow指针的两倍。所以当fast遍历到链表的末尾时,slow恰好找到了链表的最中间位置,(这是使用链表存储相对于数组比较麻烦的地方,没办法直接选取最中间的值)。 2、使用 阅读全文

posted @ 2016-05-20 16:50 时间的女儿 阅读(1060) 评论(0) 推荐(0) 编辑

2016年5月9日

《自控力》读书笔记

摘要: 1、意志力与压力的生理学基础是相互排斥的,通过加压来增加自控力只在短期内有效。疲惫不堪、处于高压之中更容易缺乏意志力。从压力中恢复,保证有能量做最好的自己。 2、自控力的肌肉模式:如何克服意志力枯竭。 1)、血糖充足,自控力更高。但血糖的突然增加或减少会影响身体和大脑使用糖分的能力。身体含糖量高,却 阅读全文

posted @ 2016-05-09 21:13 时间的女儿 阅读(293) 评论(0) 推荐(0) 编辑

2016年4月7日

Leetcode 49. Group Anagrams (242.Valid Anagram)

摘要: valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true. 阅读全文

posted @ 2016-04-07 21:32 时间的女儿 阅读(294) 评论(0) 推荐(0) 编辑

2016年3月30日

Leetcode43. Multiply Strings

摘要: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文

posted @ 2016-03-30 22:46 时间的女儿 阅读(204) 评论(0) 推荐(0) 编辑

2016年3月28日

Leetcode 233. Number of Digit One

摘要: Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. For example:Given n = 13,Return 阅读全文

posted @ 2016-03-28 20:33 时间的女儿 阅读(477) 评论(0) 推荐(0) 编辑

导航