KISS

leetcode算法题解(Java版)-15-动态规划(斐波那契)

一、二叉树遍历

题目描述

Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.

二、动态规划（斐波那契）

题目描述

A message containing letters fromA-Zis being encoded to numbers using the following mapping:

'A' -> 1'B' -> 2...'Z' -> 26

Given an encoded message containing digits, determine the total number of ways to decode it.For example,Given encoded message”12”, it could be decoded as”AB”(1 2) or”L”(12).The number of ways decoding”12”is 2.

三、排序

题目描述

Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space to hold additional elements from B. The number of elements initialized in A and B are m and n respectively.