码迷,mamicode.com
首页 >  
搜索关键字:palindrome linked li    ( 14538个结果
leetcode -- Flatten Binary Tree to Linked List
算法:1. 对root的左子树做处理,让左子树的根节点作为,根节点的右子树,并让右子树作为左子树根节点的右子树的子树2. 递归遍历右子树public void flatten(TreeNode root) { if(root==null){ return; ...
分类:其他好文   时间:2014-05-26 23:39:49    阅读次数:253
[leetcode]Copy List with Random Pointer @ Python
原题地址:https://oj.leetcode.com/problems/copy-list-with-random-pointer/题意:A linked list is given such that each node contains an additional random pointe...
分类:编程语言   时间:2014-05-26 23:16:12    阅读次数:368
linux 修改时间 - [命令操作]
我们一般使用“date -s”命令来修改系统时间。比如将系统时间设定成1996年6月10日的命令如下。 #date -s 06/10/96 将系统时间设定成下午1点12分0秒的命令如下。 #date -s 13:12:00 注意,这里说的是系统时间,是linux由操作系统维护的。 在系统启动时,Li...
分类:系统相关   时间:2014-05-26 10:01:48    阅读次数:268
[LeetCode] [Partition List 2012-04-30]
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o...
分类:其他好文   时间:2014-05-26 09:35:28    阅读次数:266
[LeetCode] [Palindrome Number 2012-01-04]
Determine whether an integer is a palindrome. Do this without extra space.if use recursive, like check the first dig and last dig, then remove them, c...
分类:其他好文   时间:2014-05-23 02:45:15    阅读次数:230
leetcode Remove Nth Node From End of List
题目说:Try to do this in one pass 只用一遍遍历的话,p1先走n节点,p2再走,等到p1到达链表尾的时候p2正好在倒数第n+1个上面鸟 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode...
分类:其他好文   时间:2014-05-23 01:52:29    阅读次数:331
DAG图的拓扑排序 python
在DAG中DFS中顶点的出栈顺序即逆拓扑序。 def topological_sort( graph ): is_visit = dict( ( node, False ) for node in graph ) li = [] def dfs( graph, start_node ): for end_node in...
分类:编程语言   时间:2014-05-22 23:12:10    阅读次数:487
欧拉项目004:寻找最大的回文数
Problem 4: Largest palindrome product A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest pal...
分类:其他好文   时间:2014-05-22 18:48:46    阅读次数:355
JQ 更改li 颜色
国足朝鲜队美国队韩国队巴西队越南队伊拉克队
分类:其他好文   时间:2014-05-22 15:58:46    阅读次数:217
JS动态增加删除UL节点LI
JS如何动态增加删除UL节点LI及相关内容。 11111111111111111del 22222222222222222del 33333333333333333del 44444444444444444del 55555555555555555del
分类:Web程序   时间:2014-05-22 14:19:44    阅读次数:2840
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!