题目:两个链表存储数字,然后求和,和值存储在一个链表中。代码: 1 public ListNode
addTwoNumbers(ListNode l1, ListNode l2) { 2 ListNode head = new ListNode(0); 3
ListN...
分类:
其他好文 时间:
2014-06-29 15:15:57
阅读次数:
240
Implement next permutation, which rearranges
numbers into the lexicographically next greater permutation of numbers.If such
arrangement is not possibl...
分类:
其他好文 时间:
2014-06-04 21:35:20
阅读次数:
230
BComp.exe /silent /closescript /solo
@E:\compareTest\BCbatch.txttext-report layout:side-by-side
options:display-all,line-numbers title:"report" output...
分类:
Web程序 时间:
2014-05-29 12:22:11
阅读次数:
587
1.产生20个不同的两位整数的随机数,并且对它们进行由小到大的排序。特别提醒:程序要自动生成20个不同的整数,而且这些整数必须是两位的,如:3不是两位整数,58是两位整数View
Code List numbers= new List(); Random...
分类:
其他好文 时间:
2014-05-29 12:11:54
阅读次数:
258
题目链接说来算是个基础题目,可是还是各种CE,各种WA,基础还是不扎实。附上代码: 1 /** 2 *
Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 *
ListNode *ne...
分类:
其他好文 时间:
2014-05-28 23:56:38
阅读次数:
382
Ugly NumbersTime Limit:1000MSMemory
Limit:10000KTotal Submissions:19952Accepted:8856DescriptionUgly numbers are ...
分类:
其他好文 时间:
2014-05-28 17:12:39
阅读次数:
220
题目:计算一棵二叉树所有路径组成的数的总和。思考:也是DFS的基础应用。虽然还是套着别人的DFS框架写的,但是学习通常会经历先模拟,再创新的过程。代码:
1 private int sum = 0; 2 public int sumNumbers(TreeNode root) { 3...
分类:
其他好文 时间:
2014-05-28 11:13:01
阅读次数:
225
原题地址:https://oj.leetcode.com/problems/minimum-path-sum/题意:Given
amxngrid filled with non-negative numbers, find a path from top left to bottom
right w...
分类:
编程语言 时间:
2014-05-28 03:03:13
阅读次数:
320
Given an array of integers, find two numbers such
that they add up to a specific target number.The function twoSum should return
indices of the two nu...
分类:
其他好文 时间:
2014-05-26 19:50:39
阅读次数:
314
You are given two linked lists representing two non-negative numbers. The digits are
stored in reverse order and each of their nodes contain a single digit. Add the two numbers
and return i...
分类:
其他好文 时间:
2014-05-25 21:36:52
阅读次数:
268