- 博客(10)
- 收藏
- 关注
转载 Lintcode372 Delete Node in the Middle of Singly Linked List solution 题解
【题目描述】 Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node. 给定一个单链表中的一个等待被删除的节点(非表头或表尾)。请在在O(1)时间复杂度删除该链表节点。 【题目链接】 www.lintcode.c...
2018-04-07 09:42:00
165
转载 Lintcode371 Print Numbers by Recursion solution 题解
【题目描述】 Print numbers from 1 to the largest number with N digits by recursion. Notice It's pretty easy to do recursion like: recursion(i) { if i > largest number: return results.add(i)...
2018-04-06 10:55:00
140
转载 Lintcode370 Convert Expression to Reverse Polish Notation solution 题解
【题目描述】 Given an expression string array, return the Reverse Polish notation of this expression. (remove the parentheses) 给定一个表达式字符串数组,返回该表达式的逆波兰表达式(即去掉括号)。 【题目链接】 www.lintcode.com/en/proble...
2018-04-05 13:58:00
160
转载 Lintcode368 Expression Evaluation solution 题解
【题目描述】 Given an expression string array, return the final result of this expression Notice:The expression contains only integer,+,-,*,/,(,). 给一个用字符串表示的表达式数组,求出这个表达式的值。 【注】:表达式只包含整数,+,-,*,/,...
2018-04-04 19:13:00
143
转载 Lintcode367 Expression Tree Build solution 题解
【题目描述】 The structure of Expression Tree is a binary tree to evaluate certain expressions. All leaves of the Expression Tree have an number string value. All non-leaves of the Expression Tree ...
2018-04-02 14:00:00
132
转载 Lintcode362 Sliding Window Maximum solution 题解
【题目描述】 Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array, find the maximum number inside the window ...
2018-03-27 23:16:00
125
转载 Lintcode363 Trapping Rain Water solution 题解
【题目描述】 Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 给定n个非负整数,表示一个...
2018-03-27 23:15:00
177
转载 Lintcode364 Trapping Rain Water II solution 题解
【题目描述】 Givennxmnon-negative integers representing an elevation map 2d where the area of each cell is1x1, compute how much water it is able to trap after raining. ...
2018-03-27 23:14:00
174
转载 Lintcode366 Fibonacci solution 题解
【题目描述】 Find theNth number in Fibonacci sequence. A Fibonacci sequence is defined as follow: The first two numbers are 0 and 1. Theith number is the sum ofi-1th number andi-2th n...
2018-03-27 23:13:00
149
转载 Lintcode365 Count 1 in Binary solution 题解
【题目描述】 Count how many 1 in binary representation of a 32-bit integer. 计算在一个 32 位的整数的二进制表示中有多少个1. 【题目链接】 www.lintcode.com/en/problem/count-1-in-binary/ 【题目解析】 最容易想到的方法是对数字依次右移,判断每一位是否为1,...
2018-03-27 23:10:00
102
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅