上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 54 下一页
摘要: Question: Detect cycle in a directed graph Answer: Depth First Traversal can be used to detect cycle in a Graph. DFS for a connected graph produces a 阅读全文
posted @ 2019-09-09 14:43 北叶青藤 阅读(440) 评论(0) 推荐(0)
摘要: Quick Sort: Time complexity: best case O(n*lgn), worst case O(n^2) Space complexity: Best case O(lgn) -> call stack height Worse case O(n^2) -> call s 阅读全文
posted @ 2019-09-09 07:51 北叶青藤 阅读(151) 评论(0) 推荐(0)
摘要: Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it's set of nodes into two ind 阅读全文
posted @ 2019-08-29 13:31 北叶青藤 阅读(318) 评论(0) 推荐(0)
摘要: Assume you have k<=10^5 intervals [a_i, b_i] \in [1,10^18] (some of them may overlap), and you need to choose a set of intervals mutually disjoint suc 阅读全文
posted @ 2019-08-23 15:11 北叶青藤 阅读(474) 评论(0) 推荐(0)
摘要: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2019-08-19 03:51 北叶青藤 阅读(268) 评论(0) 推荐(0)
摘要: Error Retries and Exponential Backoff in AWS https://docs.aws.amazon.com/general/latest/gr/api-retries.html Numerous components on a network, such as 阅读全文
posted @ 2019-08-19 01:56 北叶青藤 阅读(431) 评论(0) 推荐(0)
摘要: Recurrence Algorithm Big-Oh Solution T(n) = T(n/2) + O(1) Binary SearchO(log n)T(n) = T(n-1) + O(1) Sequential SearchO(n)T(n) = 2 T(n/2) + O(1) Tree T 阅读全文
posted @ 2019-08-19 01:43 北叶青藤 阅读(189) 评论(0) 推荐(0)
摘要: Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be 阅读全文
posted @ 2019-08-18 03:14 北叶青藤 阅读(159) 评论(0) 推荐(0)
摘要: Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal. Exampl 阅读全文
posted @ 2019-08-16 12:18 北叶青藤 阅读(205) 评论(0) 推荐(0)
摘要: How this game is playe can be found at here. Python ROWS = 6 COLS = 7 def create_board(): return [[' ' for _ in range(COLS)] for _ in range(ROWS)] def 阅读全文
posted @ 2019-08-16 11:36 北叶青藤 阅读(682) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 54 下一页