![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
剑指Offer
zwx19961130
这个作者很懒,什么都没留下…
展开
-
二叉树的镜像
题目描述操作给定的二叉树,将其变换为源二叉树的镜像。输入描述:二叉树的镜像定义:源二叉树8/ 6 10/ \ / 5 7 9 11镜像二叉树8/ 10 6/ \ / 11 9 7 5// C program to convert a binary tree // to its mirror #include<stdio.h> #i...翻译 2019-03-13 23:25:25 · 107 阅读 · 0 评论 -
二分查找 biniary search 模板
class Solution {public: /** * @param nums: The integer array. * @param target: Target to find. * @return: The first position of target. Position starts from 0. */ int bina...翻译 2019-03-14 12:22:21 · 397 阅读 · 0 评论 -
两个栈实现队列
(By making enQueue operation costly) This method makes sure that oldest entered element is always at the top of stack 1, so that deQueue operation just pops from stack1. To put the element at top of s...翻译 2019-03-18 08:58:52 · 102 阅读 · 0 评论 -
Largest Sum Contiguous Subarray
Initialize: max_so_far = 0 max_ending_here = 0Loop for each element of the array (a) max_ending_here = max_ending_here + a[i] (b) if(max_ending_here < 0) max_ending_here =...翻译 2019-03-18 09:06:26 · 211 阅读 · 0 评论