User contributions
Jump to navigation
Jump to search
- 01:11, 21 September 2020 diff hist +23 N 7.33 Created page with " Back to Chapter 7" current
- 01:11, 21 September 2020 diff hist +23 N 7.31 Created page with " Back to Chapter 7" current
- 01:11, 21 September 2020 diff hist +23 N 7.29 Created page with " Back to Chapter 7" current
- 01:11, 21 September 2020 diff hist +23 N 7.27 Created page with " Back to Chapter 7" current
- 01:09, 21 September 2020 diff hist +334 N 7.25 Created page with "Use the BFS starting from the vertex v. For every node keep track of the level from the vertex v. When w is encountered for the first time the level of w is the length of the..." current
- 01:07, 21 September 2020 diff hist +1,381 N 7.23 Created page with " for any node in the tree, there are two possibilities # either the diameter is contained in one of the subtrees # or the node itself is at the top of the longest path in the..." current
- 01:06, 21 September 2020 diff hist +2,464 N 7.21 Created page with "(a) Compare every possible set of three vertices and test if there is an edge between the three. (b) One may be tempted to use DFS to find cycle of length 3, by maintaining a..." current
- 01:06, 21 September 2020 diff hist -1 Chapter 7 →Algorithm Design
- 01:05, 21 September 2020 diff hist +232 N 7.19 Created page with "# This translates to the question of labeling the tree with two colors, because this way each edge's vertices are colored differently. The larger group of colors is the sought..." current
- 01:04, 21 September 2020 diff hist +1,498 N 7.17 Created page with "1) We can determine that leafs should never be included into the cover. Therefore all leaves should be unmarked, which means that all of their parents should be marked. Now we..." current
- 01:03, 21 September 2020 diff hist +23 N 7.15 Created page with " Back to Chapter 7" current
- 01:03, 21 September 2020 diff hist +23 N 7.13 Created page with " Back to Chapter 7" current
- 01:02, 21 September 2020 diff hist +23 N 7.11 Created page with " Back to Chapter 7" current
- 01:02, 21 September 2020 diff hist +23 N 7.9 Created page with " Back to Chapter 7" current
- 01:01, 21 September 2020 diff hist +23 N 7.7 Created page with " Back to Chapter 7" current
- 01:01, 21 September 2020 diff hist +1,169 N 7.5 Created page with "Graphs with max degree 2, can be bipartite (even number of edges) or tripartite (odd number of edges) ----- Consider a triangle (3 edges, 3 vertices): it's not bipartite eve..." current
- 01:00, 21 September 2020 diff hist +325 N 7.3 Created page with "Induction proof: Base case: Tree composed of just two nodes: x(root) and y. There is only one way x -> y Assuming there is an unique path between x and y, we add a new leaf..." current
- 00:59, 21 September 2020 diff hist +241 N 7.1 Created page with "(a) BFS: * Graph G1: A, B, D, I, C, E, G, J, F, H * Graph G2: A, B, E, C, F, I, D, G, J, M, H, K, N, L, O, P (b) DFS: * Graph G1: A, B, C, E, D, G, H, F, J, I * Graph G2: A,..." current
- 00:58, 21 September 2020 diff hist +23 N 6.11 Created page with " Back to Chapter 6" current
- 00:58, 21 September 2020 diff hist +23 N 6.9 Created page with " Back to Chapter 6" current
- 00:58, 21 September 2020 diff hist +23 N 6.7 Created page with " Back to Chapter 6" current
- 00:58, 21 September 2020 diff hist +23 N 6.5 Created page with " Back to Chapter 6" current
- 00:58, 21 September 2020 diff hist +23 N 6.1 Created page with " Back to Chapter 6" current
- 00:57, 21 September 2020 diff hist +1,666 N 6.3 Created page with "1) Starting from left to right, the number of inversions for 1st number is n-1 for 2nd number is n-2 ... .. ....nth number is n-n = 0 Total number of inversions is..." current
- 00:56, 21 September 2020 diff hist +23 N 5.15 Created page with " Back to Chapter 5" current
- 00:56, 21 September 2020 diff hist +23 N 5.13 Created page with " Back to Chapter 5" current
- 00:56, 21 September 2020 diff hist +23 N 5.11 Created page with " Back to Chapter 5" current
- 00:56, 21 September 2020 diff hist +23 N 5.9 Created page with " Back to Chapter 5" current
- 00:56, 21 September 2020 diff hist +729 N 5.7 Created page with "<math>O(n+m)</math> is necessary and sufficient. Lower bound comes from potentially independent values along second diagonal -- upper bound comes from observing that we can el..." current
- 00:55, 21 September 2020 diff hist +520 N 5.5 Created page with "Apply binary search to find out transition point <pre> Assume set indexes are zero based FindIndex(A): 1. low = 0, high =1 2. mid = (low + high)/2 3. if(A[mid] >..." current
- 00:54, 21 September 2020 diff hist +391 N 5.3 Created page with "(1) Do a binary search within the range of <math>1-n</math>. You guess the right number within O(log n) questions. (2) If you don't know n start with a random number <math>2^..." current
- 00:53, 21 September 2020 diff hist +888 N 5.1 Created page with "'''Part -1''' Since set is sorted the max element will lie at position <pre> Since set is sorted the max element will lie at position Max = Set[k] where k != 0 Set[n..." current
- 18:37, 20 September 2020 diff hist +1,978 4.53 current
- 18:36, 20 September 2020 diff hist +802 N 4.51 Created page with "If we are allowed to maintain a second stack on the side, this should be possible. The main stack is a regular stack that can be implemented using an array and an index to the..." current
- 18:36, 20 September 2020 diff hist 0 4.53
- 18:36, 20 September 2020 diff hist +802 N 4.53 Created page with "If we are allowed to maintain a second stack on the side, this should be possible. The main stack is a regular stack that can be implemented using an array and an index to the..."
- 18:35, 20 September 2020 diff hist +23 N 4.49 Created page with " Back to Chapter 4" current
- 18:34, 20 September 2020 diff hist +475 N 4.47 Created page with " For a known set of integer numbers ( assume Nr-1, Nr-2 ... Nr-k) the best is to use a non-comparison based sort algorithm like radix sort with O(n) You have an array that cr..." current
- 18:33, 20 September 2020 diff hist +23 N 4.45 Created page with " Back to Chapter 4" current
- 18:32, 20 September 2020 diff hist +23 N 4.43 Created page with " Back to Chapter 4" current
- 18:32, 20 September 2020 diff hist +23 N 4.41 Created page with " Back to Chapter 4" current
- 18:31, 20 September 2020 diff hist +23 N 4.39 Created page with " Back to Chapter 4" current
- 18:30, 20 September 2020 diff hist +23 N 4.37 Created page with " Back to Chapter 4" current
- 18:30, 20 September 2020 diff hist +668 N 4.35 Created page with "It's not clear to me if the first <math>n - \sqrt n</math> element being sorted means that the remaining <math>\sqrt n</math> elements are all bigger or not, but let's suppose..." current
- 18:30, 20 September 2020 diff hist +23 N 4.33 Created page with " Back to Chapter 4" current
- 18:29, 20 September 2020 diff hist +177 N 4.31 Created page with "To guarantee mergesort is stable, when merging the two subarrays together, mergesort should settle ties in the lists by choosing the lower indexed value. Back to Chapter 4" current
- 18:28, 20 September 2020 diff hist +23 N 4.29 Created page with " Back to Chapter 4" current
- 18:28, 20 September 2020 diff hist +23 N 4.27 Created page with " Back to Chapter 4" current
- 18:28, 20 September 2020 diff hist +23 N 4.25 Created page with " Back to Chapter 4" current
- 18:28, 20 September 2020 diff hist +1,721 N 4.23 Created page with "<pre> from random import choices def group_by_color(data, start, stop, color): operations_counter = 0 while start < stop and start < len(data) and stop >= 0:..." current