码迷,mamicode.com
首页 >  
搜索关键字:python objects all    ( 160304个结果)
python 数据类型
python的元组、列表、字典数据类型是很python(there python is aadjective)的数据结构。这些结构都是经过足够优化后的,所以如果使用好的话,在某些area会有很大的益处。元组 个人认为就像java的数组,python中的元组有以下特性:任意对象的有序集合,这条没啥说的...
分类:编程语言   时间:2014-07-25 14:01:01    阅读次数:246
各种排序oc实现
// //??main.m //??OrderTest // //??Created?by?Roeru?on?23/7/14. //??Copyright?(c)?2014?Shinoi.?All?rights?reserved. // #import?<Foundation/Foundation.h> void?noNameSort(int?a...
分类:其他好文   时间:2014-07-25 11:39:52    阅读次数:299
python在windows下安装模块错误
windows下安装模块错误 1)Unable to find vcvarsall.bat : 打开“\Lib\distutils\msvc9compiler.py” 找到 toolskey = “VS%0.f0COMNTOOLS” % version, 直接修改为 toolskey = “VS100COMNTOOLS”  (如果是vs2012或者vs2013则要从100改成120) 2...
分类:编程语言   时间:2014-07-25 11:17:01    阅读次数:240
【LeetCode】【Python】Linked List Cycle
Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 思路:笨办法是每个节点再开辟一个属性存放是否访问过,这样遍历一遍即可知道是否有环。但为了不增加额外的空间,可以设置两个指针,一个一次走一步,另一个一次走两步...
分类:编程语言   时间:2014-07-25 11:09:21    阅读次数:206
【LeetCode】【Python】Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 比较简单,就是转化成中序遍历即可,访问顺序是中序遍历左子树,根节点,中序遍历右子树 Python编程的时候需要注意,要在返回单一数字的时候加...
分类:编程语言   时间:2014-07-25 11:07:51    阅读次数:221
Mac常用快捷键
Mac使用快捷键会节省很多时间。使用最多的键就是shift键  option键 command键的组合了。当然一下稍微用得多一点点,还有很多快捷键没一一列举了 进入指定目录的一些快捷键 进入 All My Files目录: shift+command+f 进入Documents目录:shift+command+o 进入Desktop目录:shift+command+d 进入Home目录:...
分类:其他好文   时间:2014-07-25 11:02:51    阅读次数:281
【leetcode刷题笔记】Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.题解,很巧妙的一道题,对于一个0-1矩阵,它的每一行及以上都可以看...
分类:其他好文   时间:2014-07-25 10:53:01    阅读次数:292
[XPath/Python] XPath 与 lxml (二)XPath 语法
XPath 选取节点时使用的表达式是一种路径表达式。节点是通过路径(path)或者步(steps)来选取的。本章使用以下 XML 文档作为示例。 Harry Potter 29.99 Learning XML 39.95...
分类:编程语言   时间:2014-07-25 10:52:41    阅读次数:301
python 在调用时计算默认值
大家都知道python的默认值是在函数定义时计算出来的, 也就是说默认值只会计算一次, 之后函数调用时, 如果参数没有给出,同一个值会赋值给变量, 这会导致, 如果我们想要一个list默认值, 新手通常这么写:def foo(a=[]): a.append(3) print a其实是错误的,两次调用...
分类:编程语言   时间:2014-07-25 05:59:57    阅读次数:233
LeetCode "Longest Consecutive Sequence"
Comparison-based sorting takes O(nlgn), so hashset is a good idea. After keeping records of all numbers in the hashset, you start checking each number...
分类:其他好文   时间:2014-07-25 03:40:54    阅读次数:305
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!