文章 2017-12-03 来自:开发者社区

[LeetCode] Reverse Linked List II 倒置链表之二

Reverse 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 and n = 4, return ...

文章 2017-12-03 来自:开发者社区

[LeetCode] Reverse Bits 翻转位

Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as00111001...

文章 2017-12-02 来自:开发者社区

[LeetCode] Reverse Linked List 倒置链表

Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both? 之前做到 Reverse Linked List II 倒置链表之二的时候我还纳闷怎...

文章 2017-11-16 来自:开发者社区

LeetCode:Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321   Have you thought about this? Here are some good questions to ask before coding. Bonus ...

文章 2017-11-13 来自:开发者社区

leetCode 344. Reverse String 字符串

344. Reverse String Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 思路1: 使用一个新的string来存放结果。 1 2 3 4 5 6 7 8 9 10 11 12 ...

文章 2017-11-08 来自:开发者社区

LeetCode:Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end shoul...

文章 2017-11-08 来自:开发者社区

LeetCode:Reverse Words in a String

Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". 1 class Solution { 2 public: 3 void reverseWords(string &s) ...

文章 2017-11-07 来自:开发者社区

leetCode 206. Reverse Linked List 反转链表

206. Reverse Linked List Reverse a singly linked list. 反转一个链表。 思路: 采用头插法,将原来链表重新插一次返回即可。 代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 /**  * Definition for...

文章 2017-07-18 来自:开发者社区

[LeetCode]Reverse Integer题解

题目链接:7. Reverse Integer 难度:Easy Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Note: The input is assumed to be a 32-bit signed integer. Your function sh.....

文章 2016-10-28 来自:开发者社区

LeetCode:Reverse Words in a String

Reverse Words in a String 题目链接:http://oj.leetcode.com/problems/reverse-words-in-a-string/      Given an input string, reverse the string word by word.   For example, Given s = "the sky is blue", ret.....

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注