使用二分查找的序列必须是有序的。 时间复杂度O(logn),每次当前序列长度的一半。 1. 递归实现 /** * To search if the target is in a given array. If find, return the position of * the target in ...
分类:
编程语言 时间:
2020-03-23 09:42:51
阅读次数:
79
3 Longest Substring Without Repeating Characters 问题描述 Given a string, find the length of the longest substring without repeating characters. Example 1 ...
分类:
其他好文 时间:
2020-03-22 19:48:22
阅读次数:
54
"Three Integers" 枚举$a,b$ 处理 $c$ 最小上界 $cc = cb (c / cb) + 1 cb;$ 最大上界$cc = cb (c / cb) + 0 cb;$ ...
分类:
其他好文 时间:
2020-03-22 12:21:22
阅读次数:
76
LeetCode 1385. Find the Distance Value Between Two Arrays两个数组间的距离值【Easy】【Python】【暴力】 Problem "LeetCode" Given two integer arrays and , and the integer ...
分类:
编程语言 时间:
2020-03-22 10:27:21
阅读次数:
80
LeetCode 1387. Sort Integers by The Power Value将整数按权重排序【Medium】【Python】【排序】 Problem "LeetCode" The power of an integer is defined as the number of ste ...
分类:
编程语言 时间:
2020-03-22 10:23:56
阅读次数:
87
2.(101)对称二叉树 2020年3月20日 Symmetric Tree Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, thi ...
分类:
其他好文 时间:
2020-03-21 21:50:27
阅读次数:
86
原题链接在这里:https://leetcode.com/problems/rotate-string/ 题目: We are given two strings, A and B. A shift on A consists of taking string A and moving the le ...
分类:
其他好文 时间:
2020-03-21 14:31:02
阅读次数:
42
Given any positive integer N , you are supposed to find all of its prime factors, and write them in the format N = p 1 k 1× p 2 k 2×?× p m k m . Input ...
分类:
其他好文 时间:
2020-03-21 13:10:32
阅读次数:
77
原题链接在这里:https://leetcode.com/problems/implement-rand10-using-rand7/ 题目: Given a function rand7 which generates a uniform random integer in the range 1 ...
分类:
其他好文 时间:
2020-03-21 09:59:59
阅读次数:
57
LeetCode 0102. Binary Tree Level Order Traversal二叉树的层次遍历【Medium】【Python】【BFS】 Problem "LeetCode" Given a binary tree, return the level order traversal ...
分类:
编程语言 时间:
2020-03-20 23:49:28
阅读次数:
74