# 标签归档：leetcode

## 题目描述：

Sort a linked list in O(n log n) time using constant space complexity.

## Python代码：

``````# Definition for singly-linked list.
# class ListNode:
#     def __init__(self, x):
#         self.val = x
#         self ...``````

## 题目描述：

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

• push(x) -- Push element x onto stack.
• pop() -- Removes the element on top of the stack.
• top() -- Get the top element.
• getMin() -- Retrieve ...

## 题目描述：

LeetCode 154. Find Minimum in Rotated Sorted Array II

Follow up for "Find Minimum in Rotated Sorted Array":
What if duplicates are allowed?

Would this affect the run-time complexity? How and why?

Suppose a sorted array is rotated at ...

## [Leetcode]Max Points on a Line 作者是 在线疯狂 发布于 2014年10月16日 在 LeetCode, Python.

### 题目描述

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

## [Leetcode]Evaluate Reverse Polish Notation 作者是 在线疯狂 发布于 2014年10月16日 在 LeetCode, Python.

### 题目描述

Evaluate the value of an arithmetic expression in Reverse Polish Notation.

Valid operators are +, -, *, /. Each operand may be an integer or another expression.

Some examples:
["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9 ...