Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:
其他好文 时间:
2014-09-01 12:15:43
阅读次数:
169
随机输入一个数,判断它是不是对称数(回文数)(如3,121,12321,45254)。不能用字符串库函数 1 bool Symmetry(int input) 2 { 3 int number = input; 4 int reverse = 0; 5 while (numb...
分类:
其他好文 时间:
2014-09-01 10:33:52
阅读次数:
230
问题描述
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
解决方案public class Solution {
public String reverseWord...
分类:
其他好文 时间:
2014-08-31 23:04:42
阅读次数:
232
LeetCode: Reverse Linked ListReverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 ...
分类:
其他好文 时间:
2014-08-31 22:45:51
阅读次数:
215
LeetCode: Binary Tree Inorder TraversalGiven a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}...
分类:
其他好文 时间:
2014-08-31 22:38:11
阅读次数:
215
Binary Tree Preorder TraversalGiven a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:
其他好文 时间:
2014-08-31 18:34:41
阅读次数:
180
Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:
其他好文 时间:
2014-08-31 18:27:01
阅读次数:
168
Question: Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky ...
分类:
其他好文 时间:
2014-08-31 17:03:21
阅读次数:
232
---恢复内容开始---Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lis...
分类:
其他好文 时间:
2014-08-31 17:01:51
阅读次数:
270
#include #include using namespace std;void reverse(char* str) { int length = strlen(str); char* str_head = str; char* str_tail = &str[length-1]; w...
分类:
其他好文 时间:
2014-08-31 06:03:10
阅读次数:
253