题目描述
输入三个整数,按由小到大的顺序输出。分别使用指针和引用方式实现两个排序函数。在主函数中输入和输出数据。
输入
三个整数
输出
由小到大输出成一行,每个数字后面跟一个空格。由指针方式实现。
由小到大输出成一行,每个数字后面跟一个空格。由引用方式实现。
样例输入
2 3 1
样例输出
1 2 3
1 2 3
提示...
分类:
其他好文 时间:
2015-01-08 18:13:41
阅读次数:
153
题目描述
输入三个字符串,按由小到大的顺序输出。分别使用指针和引用方式实现两个排序函数。在主函数中输入和输出数据。
输入
3行字符串
输出
按照从小到大输出成3行。由指针方式实现。
按照从小到大输出成3行。由引用方式实现。
样例输入
cde
afg
abc
样例输出
abc
afg
cde
abc
afg
cde
提示
...
分类:
其他好文 时间:
2015-01-08 18:06:47
阅读次数:
803
https://oj.leetcode.com/problems/palindrome-partitioning/http://blog.csdn.net/linhuanmars/article/details/22777711publicclassSolution{
publicList<List<String>>partition(Strings){
//NP
List<List<String>>result=newArrayList<>()..
分类:
其他好文 时间:
2015-01-08 15:30:19
阅读次数:
111
Description
有一字符串,包含n个字符。写一函数,将此字符串中从第m个字符开始的全部字符复制成为另一个字符串。
Input
数字n 一行字符串数字m
Output
从m开始的子串
Sample Input
6
abcdef
3
Sample Output
cdef
HINT
主函数已给定如下,...
分类:
其他好文 时间:
2015-01-08 09:42:28
阅读次数:
153
题目描述
输入10个整数,将其中最小的数与第一个数对换,把最大的数与最后一个数对换。写三个函数; ①输入10个数;②进行处理;③输出10个数。
输入
10个整数
输出
整理后的十个数,每个数后跟一个空格(注意最后一个数后也有空格)
样例输入
2 1 3 4 5 6 7 8 10 9
样例输出
1 2 3 4 5 6 7 8 9 ...
分类:
其他好文 时间:
2015-01-08 09:41:32
阅读次数:
176
The problem:Convert Sorted List to Binary Search TreeLink:https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/My analysis:The i...
分类:
其他好文 时间:
2015-01-08 02:02:08
阅读次数:
179
https://oj.leetcode.com/problems/valid-palindrome/http://blog.csdn.net/linhuanmars/article/details/22775045publicclassSolution{
publicbooleanisPalindrome(Strings){
{
if(s==null)
returnfalse;
if(s.isEmpty())
returntrue;
char[]chars=s.toLowerCase().toCharAr..
分类:
其他好文 时间:
2015-01-07 19:15:41
阅读次数:
149
https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/http://blog.csdn.net/linhuanmars/article/details/22969069/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSoluti..
分类:
其他好文 时间:
2015-01-07 19:14:02
阅读次数:
158
https://oj.leetcode.com/problems/word-ladder/http://blog.csdn.net/linhuanmars/article/category/1918893/2publicclassSolution{
publicintladderLength(Stringstart,Stringend,Set<String>dict)
{
//Putendintodict
Set<String>dictionary=newHashSet<>..
分类:
其他好文 时间:
2015-01-07 19:08:18
阅读次数:
91
https://oj.leetcode.com/problems/word-ladder-ii/http://blog.csdn.net/linhuanmars/article/details/23071455publicclassSolution{
publicList<List<String>>findLadders(Stringstart,Stringend,Set<String>dict)
{
List<List<String>>toRetu..
分类:
其他好文 时间:
2015-01-07 19:05:33
阅读次数:
201