码迷,mamicode.com
首页 >  
搜索关键字:list remove    ( 61976个结果
【LeetCode】Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.1. 将LinkedList的值保存到一个数组中,转化成Convert Sorte...
分类:其他好文   时间:2014-05-12 05:53:09    阅读次数:367
[leetcode]Flatten Binary Tree to Linked List @ Python
原题地址:http://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/题意:Given a binary tree, flatten it to a linked list in-place.For example,Given...
分类:编程语言   时间:2014-05-12 05:30:32    阅读次数:367
【LeetCode】Insertion Sort List
Sort a linked list using insertion sort.//用到O(N)的额外空间public class Solution { public ListNode insertionSortList(ListNode head) { if(head==nul...
分类:其他好文   时间:2014-05-11 23:59:09    阅读次数:405
【LeetCode】Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:其他好文   时间:2014-05-11 18:15:52    阅读次数:300
hackerrank---List Comprehensions
题目链接刷刷Python基本功...列表解析附上代码:1 x = int(input())2 y = int(input())3 z = int(input())4 n = int(input())5 print [[i, j, k] for i in xrange(x+1) for j in xr...
分类:其他好文   时间:2014-05-11 18:05:07    阅读次数:276
使用sqlite保存数据返回主键
/// /// 返回insert后的主键值 /// /// /// /// public static int ExecuteSql(string SQLString, List para) ...
分类:数据库   时间:2014-05-11 16:07:50    阅读次数:400
【LeetCode】Reverse Linked List II
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No...
分类:其他好文   时间:2014-05-11 16:03:43    阅读次数:327
leetcode第一刷_Remove Duplicates from Sorted Array II
水题。 我之前说过包含至多几个至少几个的问题都比较难,这个题可是让我大脸了。至多可以重复一次,那就重复次数多于两次再计算重复,否则的话像普通的数据一样直接按照重复次数前移就可以了嘛。不过说归说,这种inspace的思想还是有些用处的,数组这种实现方式致命的缺点就是删除或者添加中间的元素代价太大,因为不好把握数据的最终位置。这个题是一种情况,合并两个排序好的数组也是一个例子。 class Sol...
分类:其他好文   时间:2014-05-11 14:54:49    阅读次数:248
java 容器Collection List Set Map概述
对JAVA的集合的理解是想对于数组   数组是大小固定的,并且同一个数组只能存放类型一样的数据(基本类型/引用类型)   JAVA集合可以存储和操作数目不固定的一组数据。   所有的JAVA集合都位于 java.util包中!   JAVA集合只能存放引用类型的的数据,不能存放基本数据类型.   JAVA集合主要分为三种类型:   Set(集)   List(列表)   Map(映...
分类:编程语言   时间:2014-05-11 13:24:28    阅读次数:406
数据结构与算法-链表的基本操作---ShinPans
//链表操作:建立、插入、删除、查找、倒置、删除等基本操作 #include #include typedef  struct LNode {       int data;       structLNode *next; }LNode,*Llist; LNode *creat_head();//创建一个空表 void creat_list(LNode *,int);//创...
分类:其他好文   时间:2014-05-11 03:33:11    阅读次数:351
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!