
Leetcode
文章平均质量分 50
Freeland丶
Future , I'm coming... with my love...
展开
-
Swap Nodes in Pairs
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */public class Solution {public ListNode swapP原创 2015-11-09 18:15:25 · 343 阅读 · 0 评论 -
Sum Root to Leaf Numbers
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find the total sum原创 2015-11-10 20:12:02 · 294 阅读 · 0 评论 -
旋转链表---Rotate List
public class Solution { public ListNode rotateRight(ListNode head, int k) { if(head==null){ return head; } int length = getListLength(head); k =k%lengt原创 2015-11-09 22:20:45 · 514 阅读 · 0 评论