Shirlies
宁静专注认真的程序媛~
08 2016 档案
剑指offer-数值的整数次方
摘要:题目 给定一个double类型的浮点数base和int类型的整数exponent。求base的exponent次方。 链接 http://www.nowcoder.com/practice/1a834e5e3e1a4b7ba251417554e07c00?tpId=13&tqId=11165&rp= 阅读全文
posted @ 2016-08-22 12:24 Shirlies 阅读(232) 评论(0) 推荐(0) 编辑
剑指offer-二进制中1的个数
摘要:题目 输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。 链接 http://www.nowcoder.com/practice/8ee967e43c2c4ec193b040ea7fbb10b8?tpId=13&tqId=11164&rp=1&ru=/ta/coding-intervi 阅读全文
posted @ 2016-08-16 17:02 Shirlies 阅读(175) 评论(0) 推荐(0) 编辑
剑指offer-矩形覆盖
摘要:题目 我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形。请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法? 链接 http://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6?tpId=13&tqId= 阅读全文
posted @ 2016-08-16 16:59 Shirlies 阅读(167) 评论(0) 推荐(0) 编辑
剑指offer-变态跳台阶
摘要:题目 一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。求该青蛙跳上一个n级的台阶总共有多少种跳法。 链接 http://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387?tpId=13&tqId=11162&rp= 阅读全文
posted @ 2016-08-16 16:42 Shirlies 阅读(178) 评论(0) 推荐(0) 编辑
剑指offer-跳台阶
摘要:题目 一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。 链接 http://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4?tpId=13&tqId=11161&rp=1&ru=/ta/c 阅读全文
posted @ 2016-08-16 16:31 Shirlies 阅读(159) 评论(0) 推荐(0) 编辑
剑指offer-斐波那契数列
摘要:题目 大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项。 n<=39 链接 http://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=13&tqId=11160&rp=1&ru=/ta/c 阅读全文
posted @ 2016-08-16 16:26 Shirlies 阅读(228) 评论(0) 推荐(0) 编辑
剑指offer-旋转数组的最小数字
摘要:题目 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个非递减排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。NOTE:给出的所有元素都大于0,若数组大小为0,请返回0。 链接 http:// 阅读全文
posted @ 2016-08-16 16:16 Shirlies 阅读(304) 评论(0) 推荐(0) 编辑
剑指offer-用两个栈实现队列
摘要:题目 用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。 链接 http://www.nowcoder.com/practice/54275ddae22f475981afa2244dd448c6?tpId=13&tqId=11158&rp=1&ru=/ta/codi 阅读全文
posted @ 2016-08-15 14:55 Shirlies 阅读(151) 评论(0) 推荐(0) 编辑
剑指offer-重建二叉树
摘要:题目 输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。 链接 http://www.nowcoder.com/p 阅读全文
posted @ 2016-08-15 14:41 Shirlies 阅读(238) 评论(0) 推荐(0) 编辑
剑指offer-从尾到头打印链表
摘要:题目 输入一个链表,从尾到头打印链表每个节点的值。 链接 http://www.nowcoder.com/practice/d0267f7f55b3412ba93bd35cfa8e8035?tpId=13&tqId=11156&rp=1&ru=/ta/coding-interviews&qru=/t 阅读全文
posted @ 2016-08-15 11:32 Shirlies 阅读(148) 评论(0) 推荐(0) 编辑
剑指offer-替换空格
摘要:题目: 请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 链接: http://www.nowcoder.com/practice/4060ac7e3e404ad1a894ef3e1765042 阅读全文
posted @ 2016-08-15 09:12 Shirlies 阅读(281) 评论(0) 推荐(0) 编辑
leetcode-【hard】4. Median of Two Sorted Arrays
摘要:题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity 阅读全文
posted @ 2016-08-10 15:15 Shirlies 阅读(295) 评论(0) 推荐(0) 编辑
leetcode-【中等题】5. Longest Palindromic Substring
摘要:题目 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lon 阅读全文
posted @ 2016-08-08 15:03 Shirlies 阅读(301) 评论(0) 推荐(0) 编辑
leetcode-【中等题】3. Longest Substring Without Repeating Characters
摘要:题目: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the 阅读全文
posted @ 2016-08-04 14:47 Shirlies 阅读(356) 评论(0) 推荐(0) 编辑