- 博客(8)
- 收藏
- 关注
转载 Java中ArrayList类的用法(转)
1、什么是ArrayList ArrayList就是传说中的动态数组,用MSDN中的说法,就是Array的复杂版本,它提供了如下一些好处: 动态的增加和减少元素 实现了ICollection和IList接口 灵活的设置数组的大小 2、如何使用ArrayList 最简单的例子: ArrayList List = new ArrayList(); for( int i=0
2016-06-16 03:47:43 179
原创 Leetcode 171. Excel Sheet Column Number
Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ...
2016-06-04 13:45:25 172
原创 Leetcode 206. Reverse Linked List
Reverse a singly linked list. 我的代码 如果拉掉注释那一句,那么链表末尾会形成一个圈,超时 public class Solution { public ListNode reverseList(ListNode head) { ListNode before, now, after; before = head;
2016-06-04 13:25:36 172
原创 Leetcode 235. Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw
2016-06-04 12:30:04 174
原创 Leetcode 13. Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 附罗马换算算法 I 1 IV 4 V-I V 5 IX 9 X-I X 10 XL 40 L-X L
2016-06-04 09:40:06 162
原创 Leetcode 100. Same Tree
Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 我的代码: p
2016-06-02 02:31:51 153
原创 Leetcode 237. Delete Node in a Linked List
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value
2016-06-01 14:46:49 172
原创 Leetcode 283. Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums = [0, 1, 0, 3, 12], after calling you
2016-06-01 14:18:36 174
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人