Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/algorithm004-01/algorithm004-01
/ functions
Functions
6,280 in github.com/algorithm004-01/algorithm004-01
⨍
Functions
6,280
◇
Types & classes
2,806
Method
hammingWeight
:type n: int :rtype: int
Week 07/id_101/[191]位1的个数.py:44
Method
hammingWeight
(int n)
Week 07/id_216/Week07.java:6
Method
hammingWeight
(int n)
Week 07/id_431/LeetCode_191_431.java:23
Method
hammingWeight
(self, n: int)
Week 07/id_381/leetcode_191.py:2
Method
hammingWeight
(self, n: int)
Week 07/id_556/LeetCode_191_556.py:2
Method
hammingWeight
(int n)
Week 07/id_306/NumberOfOneBits.java:8
Method
hammingWeight
(int n)
Week 07/id_321/LeetCode_191_321.java:5
Method
hammingWeight
(int n)
Week 07/id_666/LeetCode_191_666.java:2
Method
hammingWeight
(self, n: int)
Week 07/id_596/LeetCode_191_596.py:2
Method
hammingWeight
(int n)
Week 07/id_476/LeetCode_191_476.java:10
Method
hammingWeight
(int n)
Week 07/id_476/LeetCode_191_476.java:23
Method
hammingWeight
(int n)
Week 07/id_476/LeetCode_191_476.java:36
Method
hammingWeight
(int n)
Week 07/id_606/191.位-1-的个数.java:60
Method
hammingWeight
仿解1:位掩码 @author Shaobo.Qian @date 2019/11/26 @link https://leetcode-cn.com/problems/number-of-1-bits/solution/wei-1de-ge-shu-by-leetcode/
Week 07/id_371/Leetcode_191_371.java:19
Method
hammingWeight
(int n)
Week 07/id_161/NumberOf1Bits.java:3
Method
hammingWeight
(int n)
Week 07/id_756/[191]]位1的个数.java:1
Method
hammingWeight
* @param Integer $n * @return Integer */
Week 07/id_566/leetcode_191_566.php:15
Method
hammingWeight
:type n: int :rtype: int
Week 07/id_251/LeetCode_191_251.py:50
Method
hammingWeight
:type n: int :rtype: int
Week 07/id_251/LeetCode_191_251.py:59
Method
hammingWeight
:type n: int :rtype: int
Week 07/id_251/LeetCode_191_251.py:73
Method
hammingWeight
:type n: int :rtype: int
Week 07/id_251/LeetCode_191_251.py:88
Method
hammingWeight
(self, n: int)
Week 07/id_176/LeetCode_191_176.py:2
Method
hammingWeight
(int n)
Week 07/id_696/LeetCode_191_696.java:5
Method
hammingWeight
Week 07/id_616/LeetCode_191_616.cpp:3
Method
hammingWeight
(int n)
Week 07/id_131/LeetCode_191_131.java:5
Method
hammingWeight
二进制表示: 11000 - 1 = 10111 11000 & 10111 = 10000 打掉了一个1, 循环这两步操作,并记录循环次数。直到值为0,循环次数即为1的个数 @param n @return
Week 07/id_006/LeetCode_191_006.java:18
Method
hammingWeight
(int n)
Week 07/id_241/LeetCode_191_241.java:7
Method
hammingWeight
(int n)
Week 07/id_681/LeetCode_191_681.java:2
Method
hammingWeight
(int n)
Week 07/id_311/LeetCode_191_Solution.java:3
Method
hammingWeight
(int n)
Week 07/id_491/LeetCode_191_491.java:3
Method
hammingWeight
:type n: int :rtype: int
Week 07/id_196/LeetCode_191_196.py:44
Method
hammingWeight
(int n)
Week 07/id_086/LeetCode_191_086.java:7
Method
hammingWeight
(int n)
Week 07/id_081/NumberOf1Bits.java:6
Method
hammingWeight
(int n)
Week 07/id_766/LeetCode_191_766.java:10
Method
hammingWeight
Week 07/id_151/LeetCode_191_151.cpp:3
Method
hammingWeight
Week 07/id_446/LeetCode_191_446.cpp:3
Method
hammingWeight
(int n)
Week 07/id_641/lesson16/LeetCode_191_641.java:7
Method
hammingWeight
(self, n: int)
Week 07/id_701/LeetCode_191_701.py:2
Method
hammingWeight
(int n)
Week 07/id_471/LeetCode_191_471.java:3
Method
hammingWeight1
仿解2:位掩码 @author Shaobo.Qian @date 2019/11/26 @link https://leetcode-cn.com/problems/number-of-1-bits/solution/wei-1de-ge-shu-by-leetcode/
Week 07/id_371/Leetcode_191_371.java:38
Method
hammingWeight1
(int n)
Week 07/id_716/LeetCode_191_716.java:4
Method
hammingWeight2
(int n)
Week 07/id_321/LeetCode_191_321.java:17
Method
hammingWeight2
(int n)
Week 07/id_716/LeetCode_191_716.java:14
Method
hammingWeight2
(int n)
Week 07/id_696/LeetCode_191_696.java:17
Method
hammingWeight2
(int n)
Week 07/id_241/LeetCode_191_241.java:16
Method
hammingWeight2
(int n)
Week 07/id_641/lesson16/LeetCode_191_641.java:20
Method
hammingWeight3
(int n)
Week 07/id_716/LeetCode_191_716.java:25
Method
hammingWeightMod
(int n)
Week 07/id_721/LeetCode_191_721.java:40
Method
hammingWeightRemoveLastIndex
移除最后一位,判断最后一位是否是1,再进行统计
Week 07/id_721/LeetCode_191_721.java:30
Method
hammingWeightRemoveLastOne
题意 计算输入是一个无符号整数,返回其二进制表达式中数字位数为 ‘1’ 的个数(汉明重量) 思路: 1. for loop ,遍历计算法 (32) 2. %2 /2 取出最后一个,判断是否为1 (32) 3. n & 1 看最低位是0 还是1, 每次 x = x >> 1向右移一位,进行下一次判断
Week 07/id_721/LeetCode_191_721.java:18
Function
hasCycle
(head)
Week 01/id_571/leetcode_141_571.js:13
Function
hasCycle
* 使用的是快慢指针的方法 * */
Week 01/id_586/141-linked-list-cycle.c:12
Method
hasCycle
(ListNode head)
Week 01/id_431/LeetCode_141_431.java:11
Method
hasCycle
:type head: ListNode :rtype: bool
Week 01/id_251/LeetCode_141_251.py:59
Method
hasCycle
中国站上面的代码,然后自己默写的 @param head @return
Week 01/id_416/LeetCode_141_416.java:33
Method
hasCycle
(ListNode head)
Week 01/id_276/HasCycle.java:4
Method
hasCycleInternational
国际站的代码,更简单,更容易理解,更加简洁 @param head @return
Week 01/id_416/LeetCode_141_416.java:56
Method
hasCycleSlowFastIndex
(self, head)
Week 01/id_251/LeetCode_141_251.py:72
Method
hash_three_sum
(self, nums)
Week 01/id_251/LeetCode_15_251.py:64
Method
hash_two_sum
(self, nums, target)
Week 02/id_251/LeetCode_1_251.py:36
Method
heapify
堆化
Week 02/id_021/algorithm/src/main/java/com/lqw/algorithm/binaryheap/SmallHeap.java:48
Function
helper
(nums, index, cur, memo)
Week 02/id_571/leetcode_78_571.js:12
Method
helper
(node, level)
Week 06/id_251/LeetCode_102_251.py:85
Method
helper
(List<List<String>> res, int[] h, bool[] v, bool[] u, bool[] d, int n, int row)
Week 06/id_546/LeetCode_51_546.cs:31
Method
helper
�ⷨ1���ݹ飬��ʱ ʱ�临�Ӷȣ�O(2^n) *******/
Week 05/id_536/leetcode_62_536.cpp:12
Method
helper
(i, j)
Week 05/id_701/LeetCode_072_701.py:5
Method
helper
Week 03/id_586/515-find-largest-value-in-each-tree-row.cc:14
Method
helper
(node: TreeNode, level: int)
Week 03/id_701/LeetCode_102_701.py:15
Method
helper
Week 02/id_166/77.combinations.cpp:9
Method
helper
(root)
Week 02/id_126/LeetCode_94_126.py:13
Method
helper
(root)
Week 02/id_121/LeetCode_590_121.py:11
Method
helper
(root)
Week 02/id_121/LeetCode_144_121.py:11
Method
helper
(root)
Week 02/id_251/LeetCode_94_251.py:40
Method
helper
Week 02/id_536/leetcode_22_536.cpp:8
Method
helper
(TreeNode root, List<Integer> res)
Week 02/id_691/LeetCode_144_691.java:30
Method
helper1
�ⷨ1��DP ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(n) ******/
Week 05/id_536/leetcode_53_536.cpp:13
Method
helper1
�ⷨ1��DP ������leetcode198���������⣬��2������� 1������ٵ�1�ң� ��dp1[i],1<i<n-1; 2����������һ��,��dp2[i],0<i<n-2;
Week 05/id_536/leetcode_213_536.cpp:17
Method
helper1
�ⷨ1:DP ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(1) *****/
Week 05/id_536/leetcode_152_536.cpp:13
Method
helper1
�ⷨ1��DP dp[i]��ʾ��ǰi�������������ٵ���������� dp[i] = max( dp[i-2] + nums[i], ����i�� dp[i-1])
Week 05/id_536/leetcode_198_536.cpp:16
Method
helper1
�ⷨ1:�ݹ� ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O() *****/
Week 05/id_536/leetcode_322_536.cpp:14
Method
helper1
�ⷨ1��λ�������ɣ�������1�����������1 ******/
Week 07/id_536/leetcode_231_536.cpp:10
Method
helper1
�ⷨ1��ģ��ʮת�����ơ�ȡģ ʱ�临�Ӷȣ�O(1) �ռ临�Ӷȣ�O(1) *******/
Week 07/id_536/leetcode_191_536.cpp:12
Method
helper1
�ⷨ1��λ�������� ******/
Week 07/id_536/leetcode_190_536.cpp:10
Method
helper1
�ⷨ1����̬�滮 1��״̬����P(x)��x����ɶ����ƺ�1�ĸ��� 2��״̬���̣�P(x) = P(x/2) + x%2; 3����ʼ����P(0) = 0; ʱ�
Week 07/id_536/leetcode_338_536.cpp:16
Method
helper1
�ⷨ1�������� ʱ�临�Ӷȣ�O(J*S) �ռ临�Ӷȣ�O(1) *****/
Week 08/id_536/leetcode_771_536.cpp:15
Method
helper1
�ⷨ1����ͨ���ַ� ʱ�临�Ӷȣ�O(logn),nΪnumֵ �ռ临�Ӷȣ�O(1) *****/
Week 03/id_536/leetcode_367_536.cpp:12
Method
helper1
�ⷨ1���ݹ鷨 ��-��-�� ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(n) *********/
Week 02/id_536/leetcode_144_536.cpp:22
Method
helper1
�ⷨ1���ݹ鷨 ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(n) *******/
Week 02/id_536/leetcode_94_536.cpp:22
Method
helper1
�ⷨ1���ݹ鷨 ��-��-�� ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(n) *******/
Week 02/id_536/leetcode_145_536.cpp:24
Method
helper2
�ⷨ2��DP,ȥ������dp[n],cur,pre������ ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(1) ******/
Week 05/id_536/leetcode_53_536.cpp:38
Method
helper2
�ⷨ2:DP,�����ݴ���СֵcurMin�� ÿ�αȽ�3��ֵ����ǰֵ����ǰֵ*���ֵ����ǰֵ*��Сֵ�� ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(1) *****/
Week 05/id_536/leetcode_152_536.cpp:44
Method
helper2
�ⷨ2:DP dp���̣�f(n) = { 0 ; ��n=0 1 + min{f(n-Ci)}; ��n>0 ע:nΪ��CiΪӲ����ֵ��iΪ��ֵ���
Week 05/id_536/leetcode_322_536.cpp:35
Method
helper2
�ⷨ2��λ�������� ******/
Week 07/id_536/leetcode_231_536.cpp:24
Method
helper2
�ⷨ2��ѭ����λ�ƶ� ʱ�临�Ӷȣ�O(1) �ռ临�Ӷȣ�O(1) *******/
Week 07/id_536/leetcode_191_536.cpp:28
Method
helper2
�ⷨ2����̬�滮 1��״̬����P(x)��x����ɶ����ƺ�1�ĸ��� 2��״̬���̣�P(x) = P(x&(x-1)) + 1; 3����ʼ����P(0) = 0;
Week 07/id_536/leetcode_338_536.cpp:33
Method
helper2
�ⷨ2��setʵ�� ʱ�临�Ӷȣ�O(J+S) �ռ临�Ӷȣ�O(J) *****/
Week 08/id_536/leetcode_771_536.cpp:32
Method
helper2
�ⷨ2��������1���Ӹ��ڵ㿪ʼ��ÿ�ε���������ǰջ��Ԫ�أ� �����亢�ӽڵ�ѹ��ջ�У���ѹ�Һ�����ѹ���ӡ� ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(n)
Week 02/id_536/leetcode_144_536.cpp:38
Method
helper2
�ⷨ2�������� ˼·���������Ϊ��->��->�� *******/
Week 02/id_536/leetcode_94_536.cpp:36
Method
helper2
�ⷨ2��������1����������ⷨ2���֡� ����-��-�� reverse��Ϊ ��-��-���� ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(n) *******/
Week 02/id_536/leetcode_145_536.cpp:40
Method
helper3
�ⷨ3:DP,���鱣������ֵ ʱ�临�Ӷ�O(n) �ռ临�Ӷ�O(n) *****/
Week 05/id_536/leetcode_152_536.cpp:70
← previous
next →
3,201–3,300 of 6,280, ranked by callers