自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Tristeza的博客

Tristeza的博客

  • 博客(259)
  • 资源 (1)
  • 收藏
  • 关注

原创 ReentrantLock中lock与unlock源码详解

   文中表格出处https://www.cnblogs.com/xrq730/p/4979021.html   文中图片出处https://blog.csdn.net/luonanqin/article/details/41871909    对于java中实现并发加锁的方式可以分为两种,一种是重量级的synchronized,一种是concurrent包下的lock接口。本系列文章将对...

2019-01-16 22:17:21 1099

转载 TCP的拥塞控制

1.引言       计算机网络中的带宽、交换结点中的缓存和处理机等,都是网络的资源。在某段时间,若对网络中某一资源的需求超过了该资源所能提供的可用部分,网络的性能就会变坏。这种情况就叫做拥塞。       拥塞控制就是防止过多的数据注入网络中,这样可以使网络中的路由器或链路不致过载。拥塞控制是一个全局性的过程,和流量控制不同,流量控制指点对点通信量的控制。2.慢开始与拥塞

2017-04-06 08:56:00 464

转载 Java.util.Collections 类

Java.util.Collections 类作者: zccstCollections 类java.util.Collections 类中定义了多种集合操作方法,实现了对集合操作方法,实现了对集合元素的排序、取极值、批量拷贝、集合结构转换、循环移位以及匹配性检查等功能,常用 static 方法如下: public static void sort(List list);    

2017-03-01 22:04:44 666

转载 关于Java并发编程的总结和思考

编写优质的并发代码是一件难度极高的事情。Java语言从第一版本开始内置了对多线程的支持,这一点在当年是非常了不起的,但是当我们对并发编程有了更深刻的认识和更多的实践后,实现并发编程就有了更多的方案和更好的选择。本文是对并发编程的一点总结和思考,同时也分享了Java 5以后的版本中如何编写并发代码的一点点经验。为什么需要并发  并发其实是一种解耦合的策略,它帮助我们把做什么(目标)和

2017-03-01 21:55:50 534

转载 Collection , List , Set 和 Map 用法和区别

Collection , List , Set 和 Map 用法和区别作者: zccstJava spring MVC 框架的调用关系是弄明白了,可是发现后面要走的路还很长,有很多东西对我还是很神秘,比如 list , set , map 等,今天就来一一解开他们的面纱。当还还有一大堆需要记忆的系统已经封装好的类、接口等等,这些内容会在以后,慢慢道来。 首先看一下他们之间的关系

2017-03-01 21:52:02 472

原创 LeetCode oj 515. Find Largest Value in Each Tree Row(DFS||BFS)

515. Find Largest Value in Each Tree RowAdd to ListDescription Submission SolutionsTotal Accepted: 3223Total Submissions: 6121Difficulty: MediumContributors: love_FDU_llp

2017-02-18 11:12:28 539

原创 Hdu oj 2602 Bone Collector(01背包)

Bone CollectorTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 56560    Accepted Submission(s): 23661Problem DescriptionMany year

2017-02-15 21:55:59 389

转载 算法导论5.2 指示器随机变量

算法导论5.2 指示器随机变量为了分析包括包括雇佣分析在内的许多算法,我们将使用指示器随机变量,它为概率和期望之间的转换提供了一个便利的方法,给定一个样本空间S和事件A,那么事件A对应的指示器随机变量:Xa   =   1 如果A发生        0 如果A没有发生E[Xa] = Pr{A}在很多时候,用指示器随机变量来求期望比用概率简

2017-02-10 09:51:02 1085 1

原创 1月2日 MyBatis联动查询+Prim算法

MyBatis联动查询:一对一映射(注解版): /** * @Interface:CompanyMapper */ @Select({ "select", "cid, name, address, pro, city, price", "from company", "where cid = #{c

2017-01-03 23:01:36 374

原创 1月1日 MyBatis创建+增删改+Kruskal算法

MyBatis创建:利用generator.xml和mybatis-generator-core-1.3.2.jar自动生成通用DAO层和通用Model层,generator.xml文件修改如下 --> --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" conn

2017-01-03 15:24:03 485

原创 Hust oj 1813 小乐乐要下山(dp + 路径还原)

小乐乐要下山Time Limit: 1000 MSMemory Limit: 32768 KTotal Submit: 292(123 users)Total Accepted: 146(117 users)Rating: Special Judge: NoDescription

2016-11-23 16:01:57 602

原创 Hust oj 1861 猥琐宅男——koko(DP)

猥琐宅男——kokoTime Limit: 1000 MSMemory Limit: 32768 KTotal Submit: 180(74 users)Total Accepted: 79(71 users)Rating: Special Judge: NoDescription

2016-11-22 19:07:56 924

原创 LeetCode oj 100. Same Tree (DFS||BFS)

100. Same Tree QuestionEditorial Solution My SubmissionsTotal Accepted: 163080Total Submissions: 364207Difficulty: EasyContributors: AdminGiven two binary trees, wr

2016-10-29 19:03:36 479

原创 Hust oj 1293 取数(Map)

取数Time Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 382(84 users)Total Accepted: 91(61 users)Rating: Special Judge: NoDescription有n个整数,给

2016-10-15 14:40:07 393

原创 LeetCode oj 409. Longest Palindrome (回文串)

409. Longest Palindrome QuestionEditorial Solution My SubmissionsTotal Accepted: 7696Total Submissions: 17179Difficulty: EasyContributors: AdminGiven a string which

2016-10-14 20:23:14 475

原创 LeetCode oj 349. Intersection of Two Arrays(HashSet)

349. Intersection of Two Arrays QuestionEditorial Solution My SubmissionsTotal Accepted: 52852Total Submissions: 118189Difficulty: EasyContributors: AdminGiven two

2016-10-14 19:58:07 320

原创 LeetCode oj 237. Delete Node in a Linked List (链表)

237. Delete Node in a Linked List QuestionEditorial Solution My SubmissionsTotal Accepted: 111980Total Submissions: 249417Difficulty: EasyContributors: AdminWrite a

2016-10-14 19:07:08 443

原创 LeetCode oj 383. Ransom Note(哈希)

383. Ransom Note QuestionEditorial Solution My SubmissionsTotal Accepted: 23593Total Submissions: 52194Difficulty: EasyContributors: Admin
Given
 an 
arbitrary
 ran

2016-10-14 18:24:24 2399

原创 LeetCode oj 238. Product of Array Except Self (思维)

238. Product of Array Except Self QuestionEditorial Solution My SubmissionsTotal Accepted: 65971Total Submissions: 144366Difficulty: MediumContributors: AdminGiven

2016-10-13 21:33:31 304

原创 Java数据结构之哈夫曼树

import java.util.*;public class TestHuffmanTree { public static void main(String [] args){ HuffmanTreehfTree = new HuffmanTree(); hfTree.insert(3, 3); hfTree.insert(2, 2); hfTree.insert(1, 1

2016-10-13 20:18:51 551

原创 LeetCode oj 392. Is Subsequence (字符串)

392. Is Subsequence QuestionEditorial Solution My SubmissionsTotal Accepted: 11558Total Submissions: 26312Difficulty: MediumContributors: AdminGiven a string s and

2016-10-13 14:00:48 289

原创 TCP状态变迁图

状态:描述CLOSED:无连接是活动的或正在进行LISTEN:服务器在等待进入呼叫SYN_RECV:一个连接请求已经到达,等待确认SYN_SENT:应用已经开始,打开一个连接ESTABLISHED:正常数据传输状态FIN_WAIT1:应用说它已经完成FIN_WAIT2:另一边已同意释放ITMED_WAIT:等待所有分组死掉CLOSING:两边同时尝试关闭TI

2016-10-13 12:48:30 464

原创 常用数据类型对应字节数 32/64

常用数据类型对应字节数  可用如sizeof(char),sizeof(char*)等得出 32位编译器:      char :1个字节      char*(即指针变量): 4个字节(32位的寻址空间是2^32, 即32个bit,也就是4个字节。同理64位编译器)      short int : 2个字节      int:  4个字节      unsi

2016-10-13 12:37:15 431

原创 MVC框架

MVC框架 MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务逻辑、数据、界面显示分离的方法组织代码,将业务逻辑聚集到一个部件里面,在改进和个性化定制界面及用户交互的同时,不需要重新编写业务逻辑。MVC被独特的发展起来用于映射传统的输入、处理和输出功能在一个逻辑的图形化用

2016-10-13 12:16:09 1655

原创 LeetCode oj 404. Sum of Left Leaves (DFS||BFS)

404. Sum of Left Leaves QuestionEditorial Solution My SubmissionsTotal Accepted: 8223Total Submissions: 17874Difficulty: EasyFind the sum of all left leaves in a gi

2016-10-06 13:33:06 699

原创 LeetCode oj 283. Move Zeroes (选择排序)

283. Move Zeroes QuestionEditorial Solution My SubmissionsTotal Accepted: 122129Total Submissions: 262841Difficulty: EasyGiven an array nums, write a function to

2016-10-05 20:58:17 354

原创 LeetCode oj 260. Single Number III (位运算)

260. Single Number III QuestionEditorial Solution My SubmissionsTotal Accepted: 49443Total Submissions: 103739Difficulty: MediumGiven an array of numbers nums, in w

2016-10-05 20:17:32 414

原创 LeetCode oj 167. Two Sum II - Input array is sorted (双指针)

167. Two Sum II - Input array is sorted QuestionEditorial Solution My SubmissionsTotal Accepted: 29576Total Submissions: 61336Difficulty: MediumGiven an array of in

2016-10-05 19:01:33 886

原创 LeetCode oj 226. Invert Binary Tree (DFS||BFS)

226. Invert Binary Tree QuestionEditorial Solution My SubmissionsTotal Accepted: 124813Total Submissions: 257083Difficulty: EasyInvert a binary tree. 4 / \

2016-10-04 18:59:10 516

原创 Pku oj 1207 The 3n + 1 problem(模拟)

The 3n + 1 problemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 56636 Accepted: 18061DescriptionProblems in Computer Science are often classified as b

2016-10-03 14:20:43 266

原创 Hust oj 1160 吸血鬼(并查集)

吸血鬼Time Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 364(173 users)Total Accepted: 213(166 users)Rating: Special Judge: NoDescription    R

2016-10-03 14:16:25 554

原创 Hust oj 1046 Balls Collision(水题)

Balls CollisionTime Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 71(51 users)Total Accepted: 49(45 users)Rating: Special Judge: NoDescription

2016-10-03 14:02:47 375

原创 Hust oj 1429 凸多边形(叉乘+二分)

凸多边形Time Limit: 2000 MSMemory Limit: 65536 KTotal Submit: 276(61 users)Total Accepted: 101(52 users)Rating: Special Judge: NoDescription已知一个

2016-10-01 14:16:46 679

原创 LeetCode oj 389. Find the Difference(Hash)

389. Find the Difference QuestionEditorial Solution My SubmissionsTotal Accepted: 22851Total Submissions: 46129Difficulty: EasyGiven two strings s and t which consi

2016-09-29 23:08:35 507

原创 LeetCode oj 104. Maximum Depth of Binary Tree(DFS||BFS)

104. Maximum Depth of Binary Tree QuestionEditorial Solution My SubmissionsTotal Accepted: 179819Total Submissions: 361510Difficulty: EasyGiven a binary tree, find

2016-09-29 02:34:32 489

原创 LeetCode oj 258. Add Digits(数字根)

258. Add Digits QuestionEditorial Solution My SubmissionsTotal Accepted: 127957Total Submissions: 257201Difficulty: EasyGiven a non-negative integer num, repeatedly

2016-09-29 01:50:49 396

原创 LeetCode oj 136. Single Number (位运算)

136. Single Number QuestionEditorial Solution My SubmissionsTotal Accepted: 158682Total Submissions: 306217Difficulty: EasyGiven an array of integers, every element

2016-09-29 01:32:46 439

原创 LeetCode oj 371. Sum of Two Integers(位运算)

371. Sum of Two Integers QuestionEditorial Solution My SubmissionsTotal Accepted: 37210Total Submissions: 71785Difficulty: EasyCalculate the sum of two integers a a

2016-09-29 01:20:45 463

原创 LeetCode oj 406. Queue Reconstruction by Height(优先队列)

406. Queue Reconstruction by Height QuestionEditorial Solution My SubmissionsTotal Accepted: 1911Total Submissions: 3604Difficulty: MediumSuppose you have a random

2016-09-28 16:31:05 716

原创 LeetCode oj 292. Nim Game(尼姆博奕)

292. Nim Game QuestionEditorial Solution My SubmissionsTotal Accepted: 100010Total Submissions: 184472Difficulty: EasyYou are playing the following Nim Game with yo

2016-09-27 19:13:27 501

KMP算法模板

KMP模板 ========================================================================

2018-04-04

空空如也

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

TA关注的人

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