找第二大 # Write your MySQL query statement belowSELECTMAX(Salary)FROMEmployeeWHERESalaryNOTIN(SELECTMAX(Salary)FROMEmployee) by 1957
largest number: Just sort. Use a_b and b_a to decide which comes at first wiggle sort: sort pair by pair wiggle sort II: Quick select algorithm to find the kth largest element in array. Can be used to find median. Remember to use three way partition and index mapping. Stack stair ...
Second largest node in the BST 2019-07-30 13:23 −Find the second largest node in the BST 分析: 如果root有右节点,很明显第二大的node有可能在右子树里。唯一不满足的条件就是右子树只有一个node. 这个时候root就是第二大node. 所以我们需要把root(可能是第二大node)也传下去。 如果roo... ...