码迷,mamicode.com
首页 >  
搜索关键字:go golang 数组 array    ( 120373个结果
LeetCode1:Two Sum
题目: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the t...
分类:其他好文   时间:2014-04-30 03:20:07    阅读次数:502
Louis Vuitton Bags Are Actually Very Versatile
It is one of the fashion trends that never go out of fashion, Louis Vuitton handbag ! And "being in fashion trends for many years, and this season is ...
分类:其他好文   时间:2014-04-30 03:07:40    阅读次数:510
Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.思路:由前序遍历数组和中序遍历...
分类:其他好文   时间:2014-04-30 02:20:33    阅读次数:366
PHP源码分析
收集一些对PHP研究较深的文章,方便平时的查阅。 1)弱类型变量实现 2)PHP的生命周期 3)变量的引用计数、写时复制(Reference counting & Copy-on-Write) 4)变量的存储方式 5)数组 6)HashTable API 7)面向对象
分类:Web程序   时间:2014-04-30 01:38:26    阅读次数:565
重构,改善既有代码的设计--第八章感悟
1.如果你看到一个数组的行为方式很像一个数据结构,就可以把数组变成对象private int aa,变成: int aa; public int GetAA() {return aa;}//好处:使得获取的数据更加有效
分类:其他好文   时间:2014-04-30 00:55:25    阅读次数:373
NSNumber包装
//1.创建一个数组对象 int、float、char等等C语言的类型无法直接放到OC的数组里面 NSMutableArray*array = [NSMutableArrayarrayWithObjects:@"1",@"2",nil]; //2.使用NSNumber对NSInte...
分类:其他好文   时间:2014-04-30 00:53:19    阅读次数:519
[LeetCode] 4Sum
Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ...
分类:其他好文   时间:2014-04-29 22:40:00    阅读次数:438
语法的省略不能造成编译器的歧义
package exp { object Main { def main(args: Array[String]): Unit = { B[String].say("hello"); //B[String]后的括号可以省略,编译器知道这不是要用类型B而是要...
分类:其他好文   时间:2014-04-29 22:15:21    阅读次数:500
快速排序
对于包含N个数的输入数组来说,快速排序是一种最坏情况时间复杂度为O(n2)的排序算法。虽然最坏情况时间复杂度很差,但是快速排序通常是实际排序应用中最好的选择,因为它的平均性能非常好:它的期望时间复杂度是O(nlgn),而且O(nlgn)中的隐藏因子非常小。另外,它还能够进行原址重排,甚至在虚存环境中...
分类:其他好文   时间:2014-04-29 21:54:47    阅读次数:508
CF243 DIV2 C Sereja and Swaps(暴力)
题意:给你一个数组,问你交换最多K个数以后,最大子串和为多少;解题思路:枚举这个数组最大字串和的起点和终点,然后优先队列交换这段里面的小数去换外面的大数,即可求出答案!解题代码: 1 // File Name: c.cpp 2 // Author: darkdream 3 // Created Ti...
分类:其他好文   时间:2014-04-29 21:44:33    阅读次数:605
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!