自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

zy2317878的博客

博观约取,厚积薄发。多读书,多看报,多做事,多交流。

  • 博客(363)
  • 收藏
  • 关注

原创 BACK!

初心不改,更进一步!

2023-05-06 18:05:34 142

原创 C++——算法题多种输入获取方法

写在前面这篇博客主要积累一下需要自己处理输入的算法题中常用的获取输入的方法。没有告诉输入多少行这种情况适用于题目没有告诉输入的确切的行数N,需要不断检测输入。例子如下:描述求两个整数A+B的和输入输入包含多组数据。每组数据包含两个整数A(1 ≤ A ≤ 100)和B(1 ≤ B ≤ 100)。输出对于每组数据输出A+B的和。样例输入1 23 4样例输出37...

2018-10-22 16:15:02 1196

原创 LeetCode——208. Implement Trie (Prefix Tree)

DescriptionImplement a trie with insert, search, and startsWith methods.ExampleTrie trie = new Trie();trie.insert("apple");trie.search("apple"); // returns truetrie.search("app"); // ret..

2018-10-11 20:14:31 427

原创 Qt——QWidget: “Must construct a QApplication before a QWidget”

写在前面这个BUG说起来要解决也很简单。C++确实要细心。参考文献:怪异问题:qwidget: must construct a qapplication before a qpaintdevice详解:qwidget: must construct a qapplication before a qpaintdevice VS报错BUG描述编译没有问题,顺利通过。运行时没有按照预计...

2018-10-08 19:49:24 8768

原创 LeetCode-207. Course Schedule

DescriptionThere are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is express...

2018-10-06 21:21:12 283

原创 OpenCV——无法打开“opencv2/opencv.hpp”文件

写在前面仍然是实验室的项目,这次,编译项目源代码发现了这样的问题。无法找到opencv2/opencv.hpp文件。很有意思。记录一下。头文件引用方法如下代码所示:#include "opencv2/opencv.hpp"然后就会报错。查找相关文件,发现只有opencv.hpp,其路径是:D:\Toolkit\OpenCV_2.4.13\opencv-2.4.13.6-x64-Ins...

2018-10-02 22:23:20 70822 15

原创 OpenCV_Viz——OpenCV中Viz的模块编译的无法解析的外部符号BUG

写在前面由于实验室需要,需要重新编译医学图像第三方库全家桶。这里就需要编译OpenCV,而编译后查看编译的库文件中缺少一个opencv_viz2413d.lib文件(没错,这里可以看出我使用的OpenCV是opencv-2.4.13.6版本)。所以需要额外重新编译这个库。首先就会遇到一个问题:默认的OpenCV编译模块中是没有Viz的。经过我之前成功编译的CMAKE配置文件仔细对比,发现需要以来...

2018-10-02 14:52:47 1929 1

原创 Windows变量路径

写在前面用Windows系统还是要多了解常用变量路径的,这样也能帮助自己多了解VS中工程的配置路径。参考文献:Windows变量路径与通配符Windows变量路径 路径名称 实际路径 %SystemDrive% 操作系统所在的分区号。如 C: %SystemRoot% 操作系统根目录。如 C:\WINDOWS %wind...

2018-09-18 19:47:41 3672

原创 LeetCode-200. Number of Islands

DescriptionGiven a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically...

2018-09-08 21:46:46 208

原创 LeetCode-236. Lowest Common Ancestor of a Binary Tree

DescriptionGiven a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betwe...

2018-09-07 21:01:45 155

原创 LeetCode-114. Flatten Binary Tree to Linked List

DescriptionGiven a binary tree, flatten it to a linked list in-place.ExampleFor example, given the following tree: 1 / \ 2 5 / \ \3 4 6The flattened tree should l...

2018-09-06 18:36:46 171

原创 Java中访问修饰符控制权限

写在前面访问修饰控制符是为了实现Java面向对象设计中的封装,其他两大特性是继承与多态。不难理解,但还是记录一下,加强记忆。好记性不如烂笔头嘛。参考文献:5.4.2 封装的实现—使用访问控制符主要内容可参考上面的链接,我觉得写得还是挺详细的。主要是解释一下后面有点遗忘的时候,如何快速捡起这些知识。访问权限表default表示默认访问修饰符,可以加,也可以不加。变量或...

2018-09-05 10:49:07 319

原创 Java中static关键字的作用与用法

写在前面这篇总结一下Java中static关键字的作用与用法。参考文献如下:[java]static关键字的四种用法Java中static关键字的作用Java中的static关键字解析Java中static关键字的作用下面直接分析static关键字的四种基本用法。修饰成员变量平时的使用当中,static最常用的功能就是修饰类的属性和方法,让他们成为类的成员属性...

2018-09-03 20:55:44 19736 6

原创 Java中this关键字的作用和用法

写在前面简单总结一下Java中this关键字的作用与用法。参考文献:Java中this关键字详解Java this 关键字用法java中this关键字的用法Java this关键字java中this关键字的作用功能概述this关键字主要有三个应用:this调用本类中的属性,也就是类中的成员变量;this调用本类中的其他方法;this调用本类中的其他构造...

2018-09-03 19:22:39 32117 7

原创 构造方法的作用和特征

写在前面这篇文章说一下Java构造方法的作用与特征,简单记录一下。构造方法的特点构造方法名一定与类同名构造方法无返回值类型(void 也不行)构造方法可以没有(默认一个无参构造方法),也可以有多个构造方法,他们之间构成重载关系如果定义有参构造函数,则默认的无参构造函数将被自动屏蔽构造方法不能被继承构造方法不能手动调用,在创建类实例的时候自动调用构造方法构造方法...

2018-09-03 15:25:14 8667

原创 类与对象的关系

写在前面简单记录一下类与对象的关系,问题不难,但觉得还是写出来,会帮助自己记忆更牢固,而且万一以后有需要,可以及时回顾。参考文献:类与对象的区别Java类和对象 详解(一)Java类和对象 详解(二)声明对象、类与对象的区别类和对象的区别基础概念1.类简单来说:类是抽象的,是对对象的抽象。具体来说:类是对现实生活中一类具有共同特征的事物的抽象,实质是一种...

2018-09-03 11:34:58 9982 1

原创 面向过程与面向对象的区别

写在前面看的网上教程出的简答题,简单记录一下。参考资料如下:心得 : 面向对象和面向过程的区别面向对象与面向过程的区别面向过程与面向对象编程的区别和优缺点面向对象与面向过程语言的区别基本概念1.面向过程 procedure oriented programming POP 以事件为中心的编程思想。就是分析出解决问题所需的各个步骤,然后用函数把这些步骤按顺序实现,并...

2018-09-03 11:07:38 375

原创 LeetCode-102. Binary Tree Level Order Traversal

DescriptionGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). ExampleGiven binary tree [3,9,20,null,null,15,7], 3 ...

2018-08-13 14:37:52 193

原创 Visual Studio——LNK1561: 必须定义入口点 的BUG解决方法

写在前面很简单的一个错误,也是自己没有注意到,记录一下。问题的背景是尝试使用Visual Stdio 2015来编写静态与动态链接库,在写静态链接库的时候,Debug版本没有问题,但是想尝试Release版本但是出现问题了。所以,记录一下。 参考文献:关于 LINK : fatal error LNK1561: 必须定义入口点 的解决方法上面这篇博客说的很详细了,我只是把我的具体情...

2018-08-01 14:49:36 36227 1

原创 LeetCode-98. Validate Binary Search Tree

DescriptionGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the no...

2018-07-26 14:18:05 361

原创 C++——虚函数(virtual)

写在前面这一篇博客记录一下自己理解的虚函数的相关内容。虚函数在刚开始学习C++的时候并不理解为什么需要这个东西?现在觉得要理解这个概念,需要对面向对象编程这个软件设计模式要有了解。学习C++不光要能理解语法特征,还要明白一些常用的软件设计模式。 这篇博客我也还是会结合一些网络上的资料,加上自己的理解阐述一下对虚函数的理解。参考资料c++ 深入理解虚函数C++ 虚函数表解析对于...

2018-07-20 16:13:54 350

原创 C++——友元(friend)

写在前面这一篇博客简单的记录一下我对于友元的理解。友元可以是个函数,就称为友元函数,也可以是一个类,就称为友元类。类,(这个我还没有专门整理),具有封装信息与提供结构的特性。public可以为外部提供调用接口,private则隐藏与类相关的数据方法等,起到抽象对象的作用。所以,只有内的成员函数才能访问类的私有成员,程序中其他的函数是无法访问私有成员变量的,但是能够访问类中的公有变量或者函数。...

2018-07-11 17:18:28 483

原创 C++——回调函数

写在前面这里学习一下回调函数,主要也是参考网上的资料做一个简单的整理。参考文献:C++回调函数的一点理解C++ 使用回调函数的方式 和 作用。 持续更新示例代码#include <iostream>using namespace std;typedef void (*Func)(int);Func p = NULL;void caller(F...

2018-07-10 11:31:21 801

原创 LeetCode-394. Decode String

DescriptionGiven an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Not...

2018-07-08 14:05:12 158

原创 HTML5——HTML5元素周期表

写在前面其实自己看了HTML5好久了,主要标签多少也都有用过了,但是呢,缺少一定的总结。看了一遍相当于再读代码不会陌生,但是只有总结才能把知识整理成自己的,相当于对于这一块知识有了头绪。HTML5元素周期表发现HTML5元素周期表,整理一下:有两个版本:中文:HTML5 标签含义之元素周期表英文:Periodic Table of the HTML5 Elements...

2018-07-07 22:40:10 6175

原创 LeetCode-46. Permutations

DescriptionGiven a collection of distinct integers, return all possible permutations.ExampleInput: [1,2,3]Output:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]Sol...

2018-07-07 20:35:53 226

原创 LeetCode-322. Coin Change

DescriptionYou are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that a...

2018-07-07 19:45:12 165

原创 LeetCode-221. Maximal Square

DescriptionGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.ExampleInput: 1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0Output:...

2018-07-06 19:11:46 165

原创 LeetCode-139. Word Break

DescriptionGiven a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary word...

2018-07-06 17:40:30 137

原创 LeetCode-416. Partition Equal Subset Sum

DescriptionGiven a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note1.Eac...

2018-07-06 15:57:46 148

原创 LeetCode-309. Best Time to Buy and Sell Stock with Cooldown

DescriptionSay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you lik...

2018-07-05 16:38:49 115

原创 LeetCode-96. Unique Binary Search Trees

DescriptionGiven n, how many structurally unique BST's (binary search trees) that store values 1 ... n?ExampleInput: 3Output: 5Explanation:Given n = 3, there are a total of 5 unique BST...

2018-07-05 16:16:09 114

原创 LeetCode-494. Target Sum

DescriptionYou are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol....

2018-07-05 15:27:16 237

原创 LeetCode-338. Counting Bits

DescriptionGiven a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.Example...

2018-07-04 14:29:55 162

原创 LeetCode-215. Kth Largest Element in an Array

DescriptionFind the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.Example 1Input: [3,2,1,5,6,4] and k ...

2018-07-04 13:32:52 138

原创 LeetCode-240. Search a 2D Matrix II

DescriptionWrite an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.In...

2018-07-04 11:19:28 150

原创 LeetCode-5. Longest Palindromic Substring

DescriptionGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1Input: "babad"Output: "bab"Note: "aba" is also a vali...

2018-07-03 20:28:00 111

原创 LeetCode-17. Letter Combinations of a Phone Number

DescriptionGiven a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone ...

2018-07-03 19:59:19 145

原创 LeetCode-22. Generate Parentheses

DescriptionGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.ExampleFor example, given n = 3, a solution set is:[ "((()))", "(()())...

2018-07-02 20:20:30 114

原创 LeetCode-647. Palindromic Substrings

DescriptionGiven a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings eve...

2018-07-02 20:07:15 122

空空如也

空空如也

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

TA关注的人

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