My own daily algorithm exercise set.
#20161210log
Today's question is Binary Tree Mirror:
English Version:
Title Description:
Transform a given binary tree into a mirror of the source tree.
Enter a description:
Binary tree mirror definition: the source binary tree
8
/ \
6 10
/ \ / \
5 7 9 11
The mirror of binary tree
8
/ \
10 6
/ \ / \
11 9 7 5
Chinese Version(中文版):
题目描述:
操作给定的二叉树,将其变换为源二叉树的镜像。
输入描述:
二叉树的镜像定义:源二叉树
8
/ \
6 10
/ \ / \
5 7 9 11
镜像二叉树
8
/ \
10 6
/ \ / \
11 9 7 5
#20161209log
Today's question is Max Difference problem:
English Version:
There is an array A of length n, and the maximum value of A [b] -A [a] satisfying 0<=a<=b <n is to be obtained.
Given the array A and its size n, return the maximum difference.
Test sample:
[10,5], 2
Returns: 0
Chinese Version(中文版):
有一个长为n的数组A,求满足0≤a≤b<n的A[b]-A[a]的最大值。
给定数组A及它的大小n,请返回最大差值。
测试样例:
[10,5],2
返回:0