上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 79 下一页
摘要: package LeetCode_961 /** * 961. N-Repeated Element in Size 2N Array * https://leetcode.com/problems/n-repeated-element-in-size-2n-array/description/ * 阅读全文
posted @ 2020-06-20 11:54 johnny_zhao 阅读(87) 评论(0) 推荐(0) 编辑
摘要: package _interview_question import java.util.* import kotlin.collections.ArrayList /** * 有1千万个随机数,随机数的范围在1到1亿之间。现在要求写出一种算法,将1到1亿之间没有在随机数中的数求出来? * */ c 阅读全文
posted @ 2020-06-19 21:32 johnny_zhao 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 什么是Bitset Bitset,也就是位图,由于可以用非常紧凑的格式来表示给定范围的连续数据而经常出现在各种算法设计上。 基本原理是,用1位来表示一个数据是否出现过,0为没有出现过,1表示出现过。使用的时候既可根据一个是否为0表示此数是否出现过。 1G的空间,有8*1024*1024*1024=8 阅读全文
posted @ 2020-06-19 13:27 johnny_zhao 阅读(415) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_670 /** * 670. Maximum Swap * https://leetcode.com/problems/maximum-swap/description/ * * Given a non-negative integer, you could swa 阅读全文
posted @ 2020-06-19 01:13 johnny_zhao 阅读(88) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_57 /** * 57. Insert Interval * https://leetcode.com/problems/insert-interval/description/ * * Given a set of non-overlapping interval 阅读全文
posted @ 2020-06-17 15:43 johnny_zhao 阅读(183) 评论(0) 推荐(0) 编辑
摘要: package _Sort.Algorithm /** * Insertion Sort * https://www.geeksforgeeks.org/insertion-sort/ * Insertion Sort is a simple sorting algorithm that works 阅读全文
posted @ 2020-06-17 11:04 johnny_zhao 阅读(115) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_56 /** * 56. Merge Intervals * https://leetcode.com/problems/merge-intervals/description/ * * Given a collection of intervals, merge 阅读全文
posted @ 2020-06-17 00:13 johnny_zhao 阅读(60) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_796 /** * 796. Rotate String * https://leetcode.com/problems/rotate-string/description/ * We are given two strings, A and B. A shift 阅读全文
posted @ 2020-06-16 13:06 johnny_zhao 阅读(169) 评论(0) 推荐(0) 编辑
摘要: package LeetCode_787 import java.util.* import kotlin.collections.ArrayList import kotlin.collections.HashMap /** * 787. Cheapest Flights Within K Sto 阅读全文
posted @ 2020-06-16 12:37 johnny_zhao 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2020-06-16 11:21 johnny_zhao 阅读(177) 评论(0) 推荐(0) 编辑
上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 79 下一页