自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(64)
  • 资源 (2)
  • 收藏
  • 关注

原创 Java深拷贝详细总结

文章目录浅拷贝深拷贝无法重写clone()时遍历复制使用构造方法传参复制使用list.addAll复制遍历new序列化深拷贝参考浅拷贝直接看例子package domain;public class Subject { private String name; private int score; public Subject(String name, int ...

2020-03-10 19:07:50 253 1

原创 算法竞赛入门经典经典例题及习题题解

Github仓库有些例题没找到完全相同的题目,找了类似的。文章目录算法竞赛入门经典第一版第5章 基础题目选解5.1 字符串5.2 高精度计算5.3 排序与检索5.4 数学基础第六章 数据结构基础6.1 栈和队列6.2 链表6.3 二叉树6.4 图第七章 暴力求解法7.1 简单枚举7.2 枚举排列7.3 子集生成7.4 回溯法7.5 隐式树的遍历第八章 高效算法设计8.1 算法初步分析8.2 再...

2020-03-10 16:22:37 3133 1

原创 LeetCode题解及源码汇总

My C++ Solutions for LeetCodeC++菜鸟,欢迎探讨指正!#TitleC++JavaPythonDifficultyCSDN1Two SumC++PythonEasyCSDN2Add Two NumbersC++MediumCSDN3Longest Substring Without Repeatin...

2019-08-04 12:11:38 3080 1

原创 TensorFlow中组合训练数据函数tf.train.batch与tf.train.batch_join的输入维度与输出维度的关系

TensorFlow读出TFRecord中的数据,然后再经过预处理操作,此时需要注意:数据还是单个,而网络的输入一般以Batch为单位,因此我们需要将单个的数据组合成一个Batch,做为神经网络的输入。TensorFlow提供组合训练数据的函数有四个:tf.train.batch(),tf.train.shuffle_batch()与tf.train.batch_join、tf.train.sh...

2018-10-16 20:49:16 1655 1

原创 sleep、yield、wait和join

文章目录概述`sleep``yield``wait``join`状态转移5个状态`sleep`和`wait`的区别`sleep`和`yield`的区别参考概述Thread.sleep(long)和Thread.yield()都是Thread类的静态方法,由Thread直接调用。join()是Thread的非静态方法,由Thread对象调用。wait()、notify()、not...

2020-03-23 19:00:32 200

原创 Runnable、Callable、Future、FutureTask

文章目录`Callable`和`Runnable`Diagram`Runnable``Callable``Future``FutureTask`构造器使用实例`Callable`+`Future`获取结果`FutureTask`+`Callable`获取结果参考Callable和RunnableDiagramRunnable@FunctionalInterfacepublic inte...

2020-03-23 15:16:23 246

原创 ReentrantLock基本使用

文章目录lock()方法实现懒汉式单例condition实现进程通信使用lockInterruptibly()方法tryLock()应用忽略重复触发带参数tryLock:超时放弃今天学习了java的lock和sychronized的区别,所以实践一下。lock()方法实现懒汉式单例package domain;import java.util.concurrent.locks.Reent...

2020-03-11 21:09:22 268

原创 剑指offer刷题

剑指offer第二版ExampleProblemSolution2.3.1 数组(面试题3)数组中重复的数字JAVA2.3.1 数组(面试题4)二维数组中的查找JAVA2.3.2 字符串(面试题5)替换空格JAVA2.3.3 链表(面试题6)从尾到头打印链表JAVA2.3.4 树(面试题7)重建二叉树JAVA2.3.4 树(...

2020-03-10 16:24:04 126

原创 LeetCode 1170:比较字符串最小字母出现频次(Compare Strings by Frequency of the Smallest Character)解法汇总

文章目录Solution更多LeetCode题解Let’s define a function f(s) over a non-empty string s, which calculates the frequency of the smallest character in s. For example, if s = "dcce" then f(s) = 2 because the sm...

2019-08-25 13:34:31 240

原创 LeetCode 1169:查询无效交易(Invalid Transactions)解法汇总

文章目录Solution更多LeetCode题解A transaction is possibly invalid if:the amount exceeds $1000, or;if it occurs within (and including) 60 minutes of another transaction with the same name in a different c...

2019-08-25 13:28:51 1217

原创 LeetCode 1154:一年中的第几天(Day of the Year)解法汇总

文章目录Solution更多LeetCode题解Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.Example 1:Input: date = “2019-01-09”Output: 9Explan...

2019-08-20 10:47:11 511

原创 LeetCode 1144:递减元素使数组呈锯齿状(Decrease Elements To Make Array Zigzag)解法汇总

文章目录Solution更多LeetCode题解Given an array nums of integers, a move consists of choosing any element and decreasing it by 1.An array A is a zigzag array if either:Every even-indexed element is greate...

2019-08-04 12:08:58 284

原创 LeetCode 48:旋转图像(Rotate Image)解法汇总

文章目录Solution更多LeetCode题解You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to modif...

2019-08-03 14:04:56 277

原创 LeetCode 47:全排列 II(Permutations II)解法汇总

文章目录Solution更多LeetCode题解Given a collection of numbers that might contain duplicates, return all possible unique permutations.Example:Input: [1,1,2]Output:[[1,1,2],[1,2,1],[2,1,1]]Solution...

2019-08-02 21:45:55 187

原创 LeetCode 46:全排列(Permutations)解法汇总

文章目录Solution更多LeetCode题解Given a collection of distinct integers, return all possible permutations.Example:Input: [1,2,3]Output:[[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]Solution...

2019-08-01 16:13:28 249

原创 LeetCode 43:字符串相乘(Multiply Strings)解法汇总

文章目录Solution更多LeetCode题解Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.Example 1:Input: num1 = “2”, num2 =...

2019-07-31 15:50:14 239

原创 LeetCode 40:组合总和 II(Combination Sum II)解法汇总

文章目录Solution更多LeetCode题解Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.Each...

2019-07-30 19:46:14 174

原创 LeetCode 39:组合总和(Combination Sum)解法汇总

文章目录Solution更多LeetCode题解Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums t...

2019-07-29 21:41:50 199

原创 LeetCode 1139:最大的以 1 为边界的正方形(Largest 1-Bordered Square)解法汇总

文章目录Solution更多LeetCode题解Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn’t exist in the grid.Exa...

2019-07-28 12:14:32 535

原创 LeetCode 1138:字母板上的路径(Alphabet Board Path)解法汇总

文章目录Solution更多LeetCode题解On an alphabet board, we start at position (0, 0), corresponding to character board[0][0].Here, board = ["abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"].We may make the f...

2019-07-28 12:11:20 383

原创 LeetCode 1137:第 N 个泰波那契数(N-th Tribonacci Number)解法汇总

文章目录Solution更多LeetCode题解The Tribonacci sequence Tn is defined as follows:T0=0T_0 = 0T0​=0, T1=1T_1 = 1T1​=1, T2=1T_2 = 1T2​=1, and Tn+3=Tn+Tn+1+Tn+2T_{n+3} = T_n + T_{n+1} + T_{n+2}Tn+3​=Tn​+Tn+1​+...

2019-07-28 12:09:08 263

原创 LeetCode 36:有效的数独(Valid Sudoku)解法汇总

文章目录Solution更多LeetCode题解Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:Each row must contain the digits 1-9 without repetitio...

2019-07-27 22:00:28 142

原创 LeetCode 38:报数(Count and Say)解法汇总

文章目录Solution更多LeetCode题解The count-and-say sequence is the sequence of integers with the first five terms as following:1112112111112211 is read off as “one 1” or 11.11 is read...

2019-07-26 23:03:29 192

原创 LeetCode 34:在排序数组中查找元素的第一个和最后一个位置(Find First and Last Position of Element in Sorted Array)解法汇总

文章目录Solution更多LeetCode题解Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the o...

2019-07-25 23:26:19 271

原创 LeetCode 33:搜索旋转排序数组(Search in Rotated Sorted Array)解法汇总

文章目录Solution更多LeetCode题解Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a target va...

2019-07-24 16:44:30 182

原创 LeetCode 1128:等价多米诺骨牌对的数量(Number of Equivalent Domino Pairs)解法汇总

文章目录My Solution更多LeetCode题解Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a==c and b==d), or (a==d and b==c) - that is, one domino can be...

2019-07-21 11:54:55 187

原创 LeetCode 31:下一个排列(Next Permutation)解法汇总

文章目录Solution更多LeetCode题解Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it...

2019-07-20 17:40:26 179

原创 LeetCode 29:两数相除(Divide Two Integers)解法汇总

文章目录Solution更多LeetCode题解Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.Return the quotient after dividing dividend by divisor....

2019-07-16 16:38:04 196

原创 LeetCode 1124:表现良好的最长时间段(Longest Well-Performing Interval)解法汇总

文章目录My Solution更多LeetCode题解We are given hours, a list of the number of hours worked per day for a given employee.A day is considered to be a tiring day if and only if the number of hours worked is ...

2019-07-14 14:05:11 2018

原创 LeetCode 1122:数组的相对排序(Relative Sort Array)解法汇总

文章目录My Solution更多LeetCode题解Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1.Sort the elements of arr1 such that the relative ordering of ...

2019-07-14 13:56:48 463

原创 LeetCode 23:合并K个排序链表(Merge k Sorted Lists)解法汇总

文章目录My Solution更多LeetCode题解Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[1->4->5,1->3->4,2->6]Output: 1-&gt...

2019-06-29 13:02:09 207

原创 Windows下Cmake+Visual Studio 2017编译OpenCV并配置(完美解决,可进入OpenCV源码)

文章目录1. 下载Cmake2. 下载OpenCV源码3. Cmake编译OpenCV4. VS2017编译生成OpenCV库5. 配置环境5.1 环境变量配置5.2 VS2017配置6. 测试本教程使用Cmake+Visual Studio 2017编译OpenCV,并在Visual Studio 2017示例项目中配置OpenCV,能够实现进入OpenCV内部源代码调试。1. 下载Cmak...

2019-06-29 10:08:39 1507 2

原创 LeetCode 35:搜索插入位置(Search Insert Position)解法汇总

文章目录My Solution更多LeetCode题解Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume n...

2019-06-27 21:29:42 275

原创 LeetCode 28:实现strStr()(Implement strStr())解法汇总

文章目录My Solution更多LeetCode题解Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = “hello”, needle ...

2019-06-19 18:40:31 131

原创 LeetCode 27:移除元素(Remove Element)解法汇总

文章目录My Solution更多LeetCode题解Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this...

2019-06-09 16:42:39 185

原创 LeetCode 26:删除排序数组中的重复项(Remove Duplicates from Sorted Array)解法汇总

文章目录My Solution更多LeetCode题解Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array,...

2019-06-08 22:09:46 180

原创 LeetCode 24:两两交换链表中的节点(Swap Nodes in Pairs)解法汇总

文章目录My Solution更多LeetCode题解My Solution由于尝试交换未成功,所以使用了一种讨巧的方法:新建一个List,向这个List内添加结点。struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {}};class Solution {public...

2019-06-07 20:23:11 181

原创 LeetCode 22:括号生成(Generate Parentheses)解法汇总

更多LeetCode题解回溯法class Solution {public: char paren[2] = { '(',')' }; vector<string> generateParenthesis(int n) { vector<string> res; string str; for (int i = 0; i < 2 * n; i...

2019-05-08 20:07:10 182

原创 LeetCode 21:合并两个有序链表(Merge Two Sorted Lists)解法汇总

更多LeetCode题解有序链表的归并排序,很简单class Solution {public: bool isValid(string s) { stack<char> sta; for (int i = 0; i < s.size(); i++) { if (s[i] == '(' || s[i] == '[' || s[i] == '{') { ...

2019-04-30 14:29:04 179

原创 LeetCode 20:有效的括号(Valid Parentheses)解法汇总

更多LeetCode题解class Solution {public: bool isValid(string s) { stack<char> sta; for (int i = 0; i < s.size(); i++) { if (s[i] == '(' || s[i] == '[' || s[i] == '{') { sta.push(s[i]...

2019-04-30 13:57:18 261

ASP.NET揭秘中文版

ASP.NET揭秘中文版,不多说什么了。这个版本是第二版 需要的来下载就是了 这个是第一部分,还有第二部分,请一块下载再使用

2021-03-18

清华大学 邓俊辉 数据结构 书本及课后答案

本书的前半部分从抽象数据类型的角度讨论各种基本类型的数据结构及其应用;后半部分主要讨论查找和排序的各种实现方法及其综合分析比较。其内容和章节编排1992年4月出版的《数据结构》(第二版)基本一致,但在本书中更突出了抽象数据类型的概念。全书采用类C语言作为数据结构和算法的描述语言。

2018-03-24

空空如也

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

TA关注的人

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