leetcode95专题

Leetcode95: Rotate Image

You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 举一个二维数组变换的例子就知道变换的坐标由a[i][j]->a[j][n-1-i] 最笨的办法就是复制数

leetcode95~Unique Binary Search Trees II

Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1…n. For example,Given n = 3, your program should return all 5 unique BST's shown below. 1 3 3 2

[LeetCode95]Search in Rotated Sorted Array II

Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in the