Number of 1 Bits
LeetCode https://leetcode.cn/problems/number-of-1-bits/ class Solution { public int hammingWeight(int n) { int res = 0; while (n != 0) { res++; ...
LeetCode https://leetcode.cn/problems/number-of-1-bits/ class Solution { public int hammingWeight(int n) { int res = 0; while (n != 0) { res++; ...
OSI模型 理解两个词 ISO & OSI ISO International Organizational for Standardization 国际标准化组织 OSI Open System Interconnection 计算机通信开放系统互连 图解:OSI模型和网际协议族中的各层 描述一个网络中各个协议层的常用方法是使用国际标准化组织(Intermati...
LeetCode https://leetcode.cn/problems/daily-temperatures/ Complexity Time = O(n) Space = O(1)
LeetCode https://leetcode.cn/problems/climbing-stairs/ class Solution { public int climbStairs(int n) { if (n < 3) return n; int[] memo = new int[n]; memo[...
LeetCode https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/ class Solution { public int maxProfit(int[] prices) { if (prices == null || prices.length < 2) { r...
LeetCode https://leetcode.cn/problems/permutations/ class Solution { public List<List<Integer>> permute(int[] nums) { List<List<Integer>> results = new ArrayLis...
transient Entry<K, V>[] table = (Entry<K, V>[]) EMPTY_TABLE; static class Entry<K, V> implements Map.Entry<K, V> { final K key; V value; Entry<K, V> next...
要了解用户态和内核态需要先了解Linux系统的体系架构: Linux 操作系统的体系架构分为:用户空间(应用程序的活动空间)和内核。 内核:Kernel 本质上可以理解为一种软件,控制计算机的硬件资源,并提供上层应用程序运行的环境。 用户空间:上层应用程序活动的空间。应用程序的执行必须依托于内核提供的资源,包括CPU资源、存储资源、I/O资源等。 系统调用:为了使上层应用能够访问...
Leetcode https://leetcode.cn/problems/subsets-ii/ 题目描述 给你一个整数数组 nums ,其中可能包含重复元素,请你返回该数组所有可能的子集(幂集)。 解集 不能 包含重复的子集。返回的解集中,子集可以按 任意顺序 排列。 示例 1: 输入:nums = [1, 2, 2] 输出:[ [], [1], [1, 2], [1, 2,...
简介 SSH 除了登录服务器,还有一大用途,就是作为加密通信的中介,充当两台服务器之间的通信加密跳板,使得原本不加密的通信变成加密通信。这个功能称为端口转发(port forwarding),又称 SSH 隧道(tunnel)。 端口转发有两个主要作用: (1)将不加密的数据放在 SSH 安全连接里面传输,使得原本不安全的网络服务增加了安全性,比如通过端口转发访问 Telnet、FTP...