摘要:
package LeetCode_961 /** * 961. N-Repeated Element in Size 2N Array * https://leetcode.com/problems/n-repeated-element-in-size-2n-array/description/ * 阅读全文
摘要:
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 阅读全文
摘要:
package LeetCode_57 /** * 57. Insert Interval * https://leetcode.com/problems/insert-interval/description/ * * Given a set of non-overlapping interval 阅读全文
摘要:
package _Sort.Algorithm /** * Insertion Sort * https://www.geeksforgeeks.org/insertion-sort/ * Insertion Sort is a simple sorting algorithm that works 阅读全文
摘要:
package LeetCode_56 /** * 56. Merge Intervals * https://leetcode.com/problems/merge-intervals/description/ * * Given a collection of intervals, merge 阅读全文
摘要:
package LeetCode_796 /** * 796. Rotate String * https://leetcode.com/problems/rotate-string/description/ * We are given two strings, A and B. A shift 阅读全文
摘要:
package LeetCode_787 import java.util.* import kotlin.collections.ArrayList import kotlin.collections.HashMap /** * 787. Cheapest Flights Within K Sto 阅读全文
摘要:
package _Algorithm.BellmanFord class BellmanFord { //create graph val ab = Edge("A", "B", -1) val ac = Edge("A", "C", 4) val bc = Edge("B", "C", 3) va 阅读全文