leetcode题目位置:面试题24.反转链表 https://leetcode-cn.com/problems/fan-zhuan-lian-biao-lcof/ 思路:借助栈的先进后出来进行反转,或者通过一个next节点来进行保存要反转到头的那个节点,防止链断裂 /** * Definition ...
分类:
其他好文 时间:
2020-03-29 10:24:17
阅读次数:
57
给定一个可包含重复数字的序列,返回所有不重复的全排列。 示例: 输入: [1,1,2]输出:[ [1,1,2], [1,2,1], [2,1,1]] 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/permutations-ii class So ...
分类:
其他好文 时间:
2020-03-28 23:16:25
阅读次数:
69
codeforces-1328E-Tree Queries 传送门:https://codeforces.com/problemset/problem/1328/E 题意:n个结点的树 m次询问 让你找一条从根结点1开始的路径 使一些点在路径上或离路径上的点距离为1 问能不能找到 因为是要求这些点在 ...
分类:
其他好文 时间:
2020-03-28 23:14:10
阅读次数:
101
94.单词的压缩编码 题目链接 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/short-encoding-of-words 题目描述 给定一个单词列表,我们将这个列表编码成一个索引字符串 S 与一个索引列表 A。 例如,如果这个列表是 ["t ...
分类:
其他好文 时间:
2020-03-28 23:10:15
阅读次数:
192
给定一个二叉树,原地将它展开为链表。 例如,给定二叉树 1 / \ 2 5 / \ \3 4 6将其展开为: 1 \ 2 \ 3 \ 4 \ 5 \ 6 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/flatten-binary-tree-to ...
分类:
其他好文 时间:
2020-03-28 21:58:14
阅读次数:
68
题目描述查看:https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/ 题目的意思是从一个有序的数组中,查找一个数,但是这个数是重复存在的,返回区间。题目要求的时间复杂度O(lo ...
分类:
编程语言 时间:
2020-03-28 21:42:00
阅读次数:
72
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12588713.html 单词的压缩编码(105min) 题目链接:https://leetcode-cn.com/problems/short-encoding-of-words/ 给定一个单词列表,我们将 ...
分类:
其他好文 时间:
2020-03-28 19:56:56
阅读次数:
77
题目地址:https://leetcode-cn.com/problems/zhong-jian-er-cha-shu-lcof/ 题目描述 输入某二叉树的前序遍历和中序遍历的结果,请重建该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。 题目示例 例如,给出 前序遍历 preorde ...
分类:
编程语言 时间:
2020-03-28 19:47:43
阅读次数:
67
今天遇到一道题,不得不说,思路决定一切,分享一下我的解题心路历程和对大佬的解题方式的解析与感想。 820. 单词的压缩编码 题目来源:https://leetcode-cn.com/problems/short-encoding-of-words/ 给定一个单词列表,我们将这个列表编码成一个索引字符 ...
分类:
其他好文 时间:
2020-03-28 19:38:35
阅读次数:
112
地址:https://leetcode-cn.com/problems/qiu-12n-lcof/ <?php /** 求 1+2+...+n ,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 示例 1: 输入: n = 3 输出 ...
分类:
其他好文 时间:
2020-03-28 10:34:54
阅读次数:
94