xixi2


  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 搜索

221. Maximal Square

发表于 2019-09-27 | 分类于 leetcode

Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area.

阅读全文 »

重载和重写

发表于 2019-09-27 | 分类于 C++基础知识

重载是指在同一作用域内的几个函数名字相同但形参列表不同,称这些函数为重载函数.
重写(override)是指子类中对父类的虚函数不继承其实现,而重新实现.

阅读全文 »

未排序数组中累加和为给定值的最长子数组系列问题

发表于 2019-09-27

原题

给定一个无序数组,其中元素可正,可负,可0.给定一个整数k,求arr所有的子数组中累加和为k的最长子数组长度.

阅读全文 »

二叉树的遍历的延伸

发表于 2019-09-27

中序遍历的延伸题

找出二叉搜索树中两个错误的节点

题目来源: leetcode
题目链接

Two elements of a binary search tree (BST) are swapped by mistake.

Recover the tree without changing its structure.

阅读全文 »

767. Reorganize String

发表于 2019-09-27 | 分类于 leetcode

Reorganize String

Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.

If possible, output any possible result. If not possible, return the empty string.

阅读全文 »

在数组中找到出现次数大于n/k的数

发表于 2019-09-27

这道题十分重要,有诸多解法,且用到许多不同的思想。

阅读全文 »

虚函数

发表于 2019-09-27

虚函数与纯虚函数

虚函数

基类希望派生类进行覆盖的函数.
当我们使用指针或引用调用虚函数时,该调用将被动态绑定.
更具体而言,使用基类的引用或指针调用一个虚成员函数时会执行动态绑定.
只有使用引用更或者指针调用虚函数时才会发生动态绑定.
每一个虚函数都必须提供定义,无论是否用到.

阅读全文 »

变形词

发表于 2019-09-27

此类题比较麻烦,但其实并不难。

阅读全文 »

数组中数字出现的次数

发表于 2019-09-27

数组中只出现一次的数

一个整型数组里除了两个数字之外,其他的数字都出现了两次。请写程序找出这两个只出现一次的数字。
题目来源:剑指offer 56

阅读全文 »

队列的最大值

发表于 2019-09-27

队列的最大值

  1. Sliding Window Maximum

Hard

Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window.

阅读全文 »
1…15161718
xixi2

xixi2

一去不复返的远方还有无法抵达的过去

175 日志
21 分类
107 标签
© 2019 xixi2
由 Hexo 强力驱动
|
主题 — NexT.Mist v5.1.4
访问人数 总访问量 次