码迷,mamicode.com
首页 >  
搜索关键字:python function    ( 188437个结果
[leetcode]LRU Cache @ Python
原题地址:http://oj.leetcode.com/problems/lru-cache/题意:设计LRU Cache参考文献:http://blog.csdn.net/hexinuaa/article/details/6630384 这篇博文总结的很到位。 https://github...
分类:编程语言   时间:2014-05-01 10:47:16    阅读次数:501
[leetcode]Linked List Cycle @ Python
原题地址:http://oj.leetcode.com/problems/linked-list-cycle/题意:判断链表中是否存在环路。解题思路:快慢指针技巧,slow指针和fast指针开始同时指向头结点head,fast每次走两步,slow每次走一步。如果链表不存在环,那么fast或者fast...
分类:编程语言   时间:2014-05-01 10:33:38    阅读次数:426
C++术语
声明( declaration )是告诉编译器某个东西的名称和类型( type ),但略去细节。下面是声明的例子:extern int x; //对象(object )声明size_t numDigits( int number ); //函数声明( function ) 声明class...
分类:编程语言   时间:2014-05-01 08:20:43    阅读次数:414
[leetcode]Linked List Cycle II @ Python
原题地址:http://oj.leetcode.com/problems/linked-list-cycle-ii/题意:如果链表中存在环路,找到环路的起点节点。解题思路:这道题有点意思。首先使用快慢指针技巧,如果fast指针和slow指针相遇,则说明链表存在环路。具体技巧参见上一篇http://w...
分类:编程语言   时间:2014-05-01 08:19:31    阅读次数:340
编写一个简单的Jquery插件
1、实现内容 定义一个简单的jquery插件,alert传递进来的参数2、插件js文件(jquery.showplugin.js)(function ($) { //定义插件中的方法 var methods = { //Object showName: function ...
分类:Web程序   时间:2014-05-01 08:09:02    阅读次数:403
回文验证
A_byte_of_Python-v192-for_Python_3.0-中文版.pdf 中的一道题:练习题: 检测一个文本是否为回文应该忽略标点,空格和大小写。 例如”Rise to vote, sir.”同样是一个回文,但是我们当前的例子无法识别它。你能改善这个例子让它做都这点吗?代码有点挫,莫...
分类:其他好文   时间:2014-05-01 06:52:33    阅读次数:359
[leetcode]Swap Nodes in Pairs @ Python
原题地址:http://oj.leetcode.com/problems/swap-nodes-in-pairs/题意:将链表中的节点两两交换。Given1->2->3->4, you should return the list as2->1->4->3.解题思路:这题主要涉及到链表的操作,没什么...
分类:编程语言   时间:2014-05-01 06:44:21    阅读次数:339
[leetcode]Remove Nth Node From End of List @ Python
原题地址:http://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/题意:Given a linked list, remove thenthnode from the end of list and return its he...
分类:编程语言   时间:2014-05-01 06:42:15    阅读次数:332
实现类成员函数回调
一、采用tri::function/bind方法实现类成员函数内部调用首先声明函数类型1 std::tr1::function func;在需要调用函数的地方绑定函数 1 switch (flgFun) { 2 case flgSine: 3 func = std::tr1::bind(&C...
分类:其他好文   时间:2014-05-01 05:03:39    阅读次数:346
梯度下降法
梯度下降法是求解无约束最优化问题的一种常用方法。实现简单,代码如下。 1 # -*- coding: utf8 -*- 2 3 delta = 0.00001 4 5 # f = x^2 + y^2 6 my_function = lambda point : point[0] ** 2 + p.....
分类:其他好文   时间:2014-05-01 03:14:54    阅读次数:267
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!