码迷,mamicode.com
首页 >  
搜索关键字:element traversal    ( 13647个结果
angularjs 从外部改变controller内的数据
var appElement = document.querySelector('[ng-controller=seatsCtrl]');var $scope = angular.element(appElement).scope();$scope.$apply(function () { $sco...
分类:Web程序   时间:2014-06-26 20:12:05    阅读次数:551
提取新闻下一页
package com.unbank.robotspider.util;import java.util.HashMap;import java.util.Map;import org.jsoup.nodes.Document;import org.jsoup.nodes.Element;impor...
分类:其他好文   时间:2014-06-26 19:07:20    阅读次数:204
leetcode 题解:Binary Tree Preorder Traversal (二叉树的先序遍历)
题目:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3]....
分类:其他好文   时间:2014-06-26 16:03:52    阅读次数:296
leetcode 题解:Binary Tree Inorder Traversal (二叉树的中序遍历)
题目:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].N...
分类:其他好文   时间:2014-06-26 16:02:42    阅读次数:172
STL中排序算法的选择
?? 当大多数程序员需要对一组对象进行排序的时候,首先想到的一个算法是sort。sort是一个非常不错的算法,但它也并非在任何场合下都是完美无缺的。有时候我们并不需要一个完全的排序操作。比如说,如果我们有一个存放Widget的矢量,而我们希望将质量最好的20个Widget送给最重要的顾客,按照顾客的重要程度送上不同质量的Widget,那么只需要排序出前20个最好的Widget,其他的Widget...
分类:其他好文   时间:2014-06-26 14:10:39    阅读次数:185
LeetCode: Single Number [136]
【题目】 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 【题意】 给定一个整数数组,其中除了一个数以外,其他数都是成对出现的,...
分类:其他好文   时间:2014-06-26 10:13:27    阅读次数:254
求一个二叉树中距离最远的两个节点
/*求二叉树中距离最远的两个点 * 基本思路: * 递归计算两棵树的最大高度,设置一个全局变量,距离最远的两个节点element * 其中:在计算左子支,直接刷新上述全局变量,在计算右边子支时,设置两个临时Node变量,变量里的element用于 * 保存右边子支的两个最远距离。根据比较两个距离的大...
分类:其他好文   时间:2014-06-25 14:54:59    阅读次数:247
javascript判断设备类型-手机(mobile)、安卓(android)、电脑(pc)、其他(ipad/iPod/Windows)等
使用device.js检测设备并实现不同设备展示不同网页html代码: 引入device.js(function() { var previousDevice, _addClass, _doc_element, _find, _handleOrientation, _hasClass...
分类:移动开发   时间:2014-06-25 14:07:19    阅读次数:275
剑指offer (30) 最小的K个数
题目:输入n个整数,找出其中最小的K个数方法一:直接std::sort,T(n) = O(nlgn)方法二:直接std::nth_element T(n) = O(n) 但是修改了原数组void MinKth(std::vector& num, int kth, std::vector& resul...
分类:其他好文   时间:2014-06-25 12:35:07    阅读次数:216
Some useful methods about linkedList.
/** * Method 1: Delete the input element x  * and meanwhile keep the length of array after deleted n * @param a  the array * @param n  the length of array after deleted. * @param x  the element t...
分类:其他好文   时间:2014-06-25 08:27:27    阅读次数:171
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!