自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 LeetCode105. Construct Binary Tree from Preorder and Inorder Traversal(递归,二叉树)

原题 Construct Binary Tree from Preorder and Inorder Traversal Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates(完全一样的东西)do not exist in the tree. 题意 就是给个二叉树的前序遍历和中序遍历,确定一棵树。 (数据结构中的常见题目,此处保证了每个

2020-05-22 10:08:08 199

原创 LeetCode560. Subarray Sum Equals K(前缀优化)

原题 Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = [1,1,1], k = 2 Output: 2 Constraints: The length of the array is in range [1, 20,000]. The range of num

2020-05-15 11:07:20 198

原创 面试题56 - I. 数组中数字出现的次数 (分组异或,优先级坑)

原题 面试题56 - I. 数组中数字出现的次数 一个整型数组 nums 里除两个数字之外,其他数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。 思路 题目思路不难,唯一难度在于空间复杂度,所以不能使用map的方法。 这里有一个异或的思路。 首先这里有几个基本公式: ①一个数与另外一个数异或两次后依旧为原来的数。 ②而一个数与0异或得到的数...

2020-04-28 12:54:15 206

原创 LeetCode542. 01 Matrix(多源最短路径,BFS)

原题 Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distance between two adjacent cells is 1. Note: The number of elements of the given matrix will not exceed 1...

2020-04-15 11:17:00 272

原创 PAT甲级A1013 Battle Over Cities (25分)(找剩余的最大连通图数量)

题目 It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we ...

2020-04-10 12:47:01 126

原创 Leetcode151. Reverse Words in a String(C++原地翻转)

原题 Given an input string, reverse the string word by word. Example 1: Input: “the sky is blue” Output: “blue is sky the” Example 2: Input: " hello world! " Output: “world! hello” Explanation: Your r...

2020-04-10 10:50:34 139

原创 PAT A1010 Radix(二分查找,进制处理)

原题 Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number. Now for any pair of positive in...

2020-04-09 17:37:10 215

原创 面试题62. 圆圈中最后剩下的数字(约瑟夫环问题)

原题 0,1,n-1这n个数字排成一个圆圈,从数字0开始,每次从这个圆圈里删除第m个数字。求出这个圆圈里剩下的最后一个数字。 例如,0、1、2、3、4这5个数字组成一个圆圈,从数字0开始每次删除第3个数字,则删除的前4个数字依次是2、0、4、1,因此最后剩下的数字是3。 思路 一开始打算用链表暴力模拟。 然后尝试了下递归就有了这道题的思路 实际上: ...

2020-03-30 19:53:01 161

原创 Leetcode 1162. As Far from Land as Possible

原题 Given an N x N grid containing only values 0 and 1, where 0 represents water and 1 represents land, find a water cell such that its distance to the nearest land cell is maximized and return the di...

2020-03-29 16:58:07 183

原创 如何在ASP.NET使用MailKit发送常规文本邮件

问题简述 在最近Web高级编程课上的项目中,有这么个要求,需要注册后发送邮件到客户注册的邮箱中。因此需要在ASP.NET中使用邮件发送。 老师给出的方法是用ASP自带的SmtpClient进行,但查询资料后发现官方已经不支持并且钦定推荐使用MailKit,详情点击我 使用方式 在Nuget中使用Install-package方式在VS2019中安装。 代码Demo public v...

2020-03-21 20:33:09 433

原创 C#重写ProcessCmdKey方法解决KeyPress失效问题

问题复现: 实现计算器程序时,发现捕捉了回车的KeyPress事件,但按下回车键依旧失效,且执行的是获得焦点按钮的click事件。 调试思路 一开始考虑到是优先级,或者是捕捉失效,后来发现进都没进Keypress,而且设立了窗体优先级KeyPreview属性后依旧如此。后来经过查找,发现一些常见的命令键位有事件设计,可以通过修改ProcessCmdKey来实现 ProcessCmdKey Proc...

2020-03-21 20:28:39 2769

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除