上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页
摘要: 题目: 求完全二叉树节点数。 思路: 满二叉树的节点数是2^k-1,k是树的深度。 所以我们可以先判断该树是否为满二叉树,然后是的话直接返回结果,如果不是递归地求解子树。 这样不用遍历所有的节点。复杂度小于O(N),比对所有点遍历复杂度要小,最好的情况是O(lgN)。 推算大概在O(lgN)~O(N 阅读全文
posted @ 2016-02-05 09:58 很好玩 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 \ 2 \ 3 阅读全文
posted @ 2016-01-29 18:02 很好玩 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ B 阅读全文
posted @ 2016-01-29 14:58 很好玩 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 利用border特性,实现三角形,很简单,我们直接看效果: html: <div class="bubble-container ">你好么 <div class="bubble-tail"></div> </div> css: .bubble-container { height: 100px; 阅读全文
posted @ 2016-01-29 14:25 很好玩 阅读(696) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The l 阅读全文
posted @ 2016-01-29 11:17 很好玩 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and 阅读全文
posted @ 2016-01-29 10:52 很好玩 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to it 阅读全文
posted @ 2016-01-28 20:06 很好玩 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 题目: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, 阅读全文
posted @ 2016-01-28 17:43 很好玩 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3  阅读全文
posted @ 2016-01-28 16:45 很好玩 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 一、什么是filter CSS滤镜属性,可以在元素呈现之前,为元素的渲染提供一些效果,如模糊、颜色转移之类的。滤镜常用于调整图像、背景、边框的渲染。目前Filter Effects Module还只是W3C的一个草案,浏览器还不完全支持,在使用时需要加浏览器前缀。 二、filter语法 /* 设置滤 阅读全文
posted @ 2016-01-28 16:19 很好玩 阅读(2467) 评论(0) 推荐(0) 编辑
摘要: 题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should return 阅读全文
posted @ 2016-01-27 23:39 很好玩 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique 阅读全文
posted @ 2016-01-27 18:19 很好玩 阅读(199) 评论(0) 推荐(0) 编辑
摘要: jquery.lazyload是一个实现图片延迟加载的jQuery 插件,它可以延迟加载长页面中的图片。在浏览器可视区域外的图片在初始状态下不会被载入,直到用户将页面滚动到它们所在的位置。1.引入js文件2.img标签"lazy" src="images/placeholder.gif" data-... 阅读全文
posted @ 2016-01-27 14:30 很好玩 阅读(12731) 评论(0) 推荐(2) 编辑
摘要: 1. 前言各位web前端开发人员,如果你现在还不知道grunt或者听说过、但是不会熟练使用grunt,那你就真的真的真的out了(三个“真的”重复,表 示重点)。至于grunt的作用,这里不详细说了,总之你如果做web前端开发,你一定要用grunt。还有一点,它完全免费,没有盗版。既强大又免费的 东... 阅读全文
posted @ 2016-01-27 12:02 很好玩 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.思路:第一次相遇时slow走过的距离:a+b,fast走过的距离:a+b+c+b。因为fast的速度是sl... 阅读全文
posted @ 2016-01-25 11:08 很好玩 阅读(148) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页