摘要:
package _interview_question import java.util.* import kotlin.collections.ArrayList /** * 有1千万个随机数,随机数的范围在1到1亿之间。现在要求写出一种算法,将1到1亿之间没有在随机数中的数求出来? * */ c 阅读全文
摘要:
什么是Bitset Bitset,也就是位图,由于可以用非常紧凑的格式来表示给定范围的连续数据而经常出现在各种算法设计上。 基本原理是,用1位来表示一个数据是否出现过,0为没有出现过,1表示出现过。使用的时候既可根据一个是否为0表示此数是否出现过。 1G的空间,有8*1024*1024*1024=8 阅读全文
摘要:
package LeetCode_670 /** * 670. Maximum Swap * https://leetcode.com/problems/maximum-swap/description/ * * Given a non-negative integer, you could swa 阅读全文