码迷,mamicode.com
首页 >  
搜索关键字:reverse nodes    ( 8673个结果
LeetCode Swap Nodes in Pairs
class Solution {public: ListNode *swapPairs(ListNode *head) { ListNode *a = NULL; ListNode *b = NULL; ListNode *tail = NULL; ...
分类:其他好文   时间:2014-06-05 12:55:24    阅读次数:216
[LeetCode] Evaluate Reverse Polish Notation
计算逆波兰表达式,了解更多关于逆波兰表达式请点击。 计算逆波兰表达式这是个很典型的栈应用的例子。 解题方法就是用栈来处理,需要注意的是本题输入给的是字符串数组,所以需要在字符串和整数之间有个转换。...
分类:其他好文   时间:2014-06-04 14:06:18    阅读次数:318
[leetcode] Reverse Words in a String
翻转字符串中的单词顺序,这是个老题目了,但是leetcode上面的要求更为严格,如: 要求把开头和结尾的空格删除掉; 缩减单词间的空格数为1(如果有多个空格); 单词若全是空格,则返回一个空字符串(""). 此题思想不难,主要是注意上面三个要求和一些细节就可以AC。 大致分为两步:一个是常规的翻转字符串中的单词;另一个就是想方法去掉串中的多余的单词;这两步骤的顺序可以颠倒。...
分类:其他好文   时间:2014-06-04 13:47:30    阅读次数:405
POJ2993——Emag eht htiw Em Pleh
Emag eht htiw Em PlehDescriptionThis problem is a reverse case of the problem 2996. You are given the output of the problem H and your task is to find...
分类:其他好文   时间:2014-06-03 15:33:20    阅读次数:347
JSON数据格式
http://blog.csdn.net/ninibinbin/article/details/3445936[ { "Id": "A", "Name": "A", "Nodes": { "Id": "A01", ...
分类:Web程序   时间:2014-06-02 13:31:12    阅读次数:287
LeetCode: Same Tree [100]
【题目】 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. 【题意】 判断了两个二叉树是否相等 【思路】 递归...
分类:其他好文   时间:2014-06-02 11:03:03    阅读次数:205
LeetCode: Validate Binary Search Tree [098]
【题目】 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with ke...
分类:其他好文   时间:2014-06-02 10:29:55    阅读次数:257
leetcode-Reverse Words in a String
Reverse Words in a String  Total Accepted: 15012 Total Submissions: 108513My Submissions Given an input string, reverse the string word by word. For example, Given s = "the sky is blue",...
分类:其他好文   时间:2014-06-02 05:34:14    阅读次数:214
leetcode Reverse Nodes in k-Group
递归一下 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: Li...
分类:其他好文   时间:2014-06-01 17:35:40    阅读次数:406
LeetCode: Add Two Numbers 题解
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 ...
分类:其他好文   时间:2014-06-01 17:05:44    阅读次数:296
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!