Fork me on GitHub
上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页
摘要: Rotate List 旋转链表 Given the head of a linked list, rotate the list to the right by k places. Input: head = [1,2,3,4,5], k = 2 Output: [4,5,1,2,3] 向右旋转 阅读全文
posted @ 2021-03-10 11:33 WilliamCui 阅读(89) 评论(0) 推荐(0)
摘要: Reverse Linked List II 反转链表 Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list 阅读全文
posted @ 2021-03-10 00:18 WilliamCui 阅读(92) 评论(0) 推荐(0)
摘要: Happy Number 快乐数 Write an algorithm to determine if a number n is happy. 判断一个数是否是快乐数 Input: n = 19 Output: true Explanation: 1^2 + 9^2 = 82 8^2 + 2^2 阅读全文
posted @ 2021-03-10 00:07 WilliamCui 阅读(299) 评论(0) 推荐(0)
摘要: Linked List Cycle find cycle begins 环形链表II [返回环的入口节点] 双指针 快慢指针,快指针一次移动2个node,慢指针一次移动1个node, 通过公式推导的结论,当快慢指针在环内相遇到的节点开始继续使用指针依次遍历到环的入口的步数等于从头结点使用指针依次遍历 阅读全文
posted @ 2021-03-10 00:04 WilliamCui 阅读(55) 评论(0) 推荐(0)
摘要: Linked List Cycle 环形链表 哈希表 利用哈希特性,在遍历的同时将节点插入hash;如果插入失败代表链表有环。 /** * Definition for singly-linked list. * class ListNode { * int val; * ListNode next 阅读全文
posted @ 2021-03-09 15:11 WilliamCui 阅读(86) 评论(0) 推荐(0)
摘要: Netty(1) 官网的介绍,Netty 是一个高性能、异步事件驱动的 NIO 框架,它提供了对 TCP、UDP 和文件传输的支持,作为一个异步 NIO 框架,Netty 的所有 IO 操作都是异步非阻塞的,通过 Future-Listener 机制,用户可以方便的主动获取或者通过通知机制获得 IO 阅读全文
posted @ 2021-03-06 17:06 WilliamCui 阅读(103) 评论(0) 推荐(0)
摘要: JAVA NIO Java的NIO是通过多路复用Selector,Channel,Buffer,来实现 NIO相较于传统I/O(BIO) NIO是面向缓冲区的。数据读取到一个它稍后处理的缓冲区,需要时可在缓冲区中前后移动,这就增加了处理过程中的灵活性。这个可以用于数据包的重组、粘包、拆包等操作。 传 阅读全文
posted @ 2021-02-28 18:43 WilliamCui 阅读(101) 评论(0) 推荐(0)
摘要: I/O模型的一些基本概念 POSIX定义 同步I/O操作(Synchronous I/O operation) 导致请求进程阻塞,直到I/O操作完成 异步I/O操作(Asynchronous I/O operation) 不导致请求进程阻塞 阻塞( Blocking ) 阻塞调用是指调用结果返回之前 阅读全文
posted @ 2021-02-26 15:59 WilliamCui 阅读(93) 评论(0) 推荐(0)
摘要: SpringBoot (3) WebServerApplicationContext SpringBoot版本 SpringBoot 2.1.6 WebServerApplicationContext 在run方法中,通过反射创建了AnnotationConfigServletWebServerAp 阅读全文
posted @ 2021-02-16 18:28 WilliamCui 阅读(791) 评论(0) 推荐(0)
摘要: SpringBoot (2) Environment SpringBoot版本 SpringBoot 2.1.6 prepareEnvironment private ConfigurableEnvironment prepareEnvironment(SpringApplicationRunLis 阅读全文
posted @ 2021-02-16 15:58 WilliamCui 阅读(248) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 14 下一页