码迷,mamicode.com
首页 >  
搜索关键字:array    ( 29504个结果
js 高阶函数 filter
filter用于过滤array中的一些值,通过带入的函数返回的ture 或false 保留或去除,返回一个新的array filter 使用演示:判断筛选出array中的素数; 1 //判断素数自定义函数; 2 function get_su(x){ 3 if(x <=3){return x>1;}
分类:Web程序   时间:2016-02-26 01:43:25    阅读次数:247
[LeetCode][JavaScript]Self Crossing
Self Crossing You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the wes
分类:编程语言   时间:2016-02-26 00:21:45    阅读次数:254
php 遍历一个文件夹下的所有文件和子文件夹
1 <?php 2 function my_scandir($dir) 3 { 4 $files=array(); 5 if(is_dir($dir)) 6 { 7 if($handle=opendir($dir)) 8 { 9 while(($file=readdir($handle))!==fa
分类:Web程序   时间:2016-02-26 00:16:29    阅读次数:339
PHP 冒泡排序法
1 <?php 2 // 冒泡排序法:将一个数组中的值按照从小到大的顺 序排序 3 $arr = array(1, 4, 5, 2, 3, 7, 9, 8); 4 $len = count($arr); 5 $len2= $len - 1; 6 for ($i = 0; $i < $len; $i+
分类:编程语言   时间:2016-02-25 22:51:02    阅读次数:204
OpenGL中旋转平移缩放等变换的顺序对模型的影响
l 前提: 0x01. 假设绘制顶点的语句为Draw Array,变换的语句(旋转、平移、缩放)为M,而 M0; M1; M2; Draw Array; 则称对Array先进行M2再进行M1、M0 0x02. 本文基于SharpGL版本的OpenGL(C#版本) l 预备知识: 0x01. gl.R
分类:其他好文   时间:2016-02-25 16:59:45    阅读次数:213
leetcode 268 Missing Number(异或运算的应用)
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1,
分类:其他好文   时间:2016-02-25 13:54:15    阅读次数:157
leetcode 162 Find Peak Element(二分法)
A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde
分类:其他好文   时间:2016-02-25 13:32:32    阅读次数:116
Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. Subscribe to see which companies asked this question
分类:其他好文   时间:2016-02-25 11:42:24    阅读次数:116
leetcode 35 Search Insert Position(二分法)
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or
分类:其他好文   时间:2016-02-25 11:31:15    阅读次数:101
[译] 理解数组在 PHP 内部的实现(给PHP开发者的PHP源码-第四部分)
原文:https://nikic.github.io/2012/03/28/Understanding-PHPs-internal-array-implementation.html 欢迎来到”给PHP开发者的PHP源码”系列的第四部分,这一部分我们会谈论PHP数组在内部是如何表示和在代码库里使用...
分类:编程语言   时间:2016-02-24 19:28:13    阅读次数:271
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!