All public logs

Jump to navigation Jump to search

Combined display of all available logs of The Algorithm Design Manual Solution Wiki. You can narrow down the view by selecting a log type, the username (case-sensitive), or the affected page (also case-sensitive).

Logs
(newest | oldest) View ( | ) (20 | 50 | 100 | 250 | 500)
  • 13:51, 21 September 2020 Algowikiadmin talk contribs created page 9.1 (Created page with "== Algorithm == Given <code>a</code>, the input array, and <code>curr</code>, the derangement built up so far: # If <code>curr</code> represents a complete solution, print i...")
  • 13:49, 21 September 2020 Algowikiadmin talk contribs created page 10.39 (Created page with "== A Python Solution - O(1) == <PRE> import sys n = int(sys.argv[1]) OUT_TMP = "Min # of coins for covering %d: %d, coins used: %s" COINS = tuple(sorted((3, 4, 9, 20, 22, 23)...")
  • 13:49, 21 September 2020 Algowikiadmin talk contribs created page 10.41 (Created page with " Back to Chapter 10")
  • 13:48, 21 September 2020 Algowikiadmin talk contribs created page 10.37 (Created page with " Back to Chapter 10")
  • 13:44, 21 September 2020 Algowikiadmin talk contribs created page 10.35 (Created page with " Back to Chapter 10")
  • 13:44, 21 September 2020 Algowikiadmin talk contribs created page 10.33 (Created page with " Back to Chapter 10")
  • 13:44, 21 September 2020 Algowikiadmin talk contribs created page 10.31 (Created page with " Back to Chapter 10")
  • 13:44, 21 September 2020 Algowikiadmin talk contribs created page 10.29 (Created page with " Back to Chapter 10")
  • 13:44, 21 September 2020 Algowikiadmin talk contribs created page 10.27 (Created page with " Back to Chapter 10")
  • 13:42, 21 September 2020 Algowikiadmin talk contribs deleted page 10.125 (content was: "#REDIRECT 10.25", and the only contributor was "Algowikiadmin" (talk))
  • 13:41, 21 September 2020 Algowikiadmin talk contribs moved page 10.125 to 10.25
  • 13:40, 21 September 2020 Algowikiadmin talk contribs created page 10.125 (Created page with " Back to Chapter 10")
  • 13:40, 21 September 2020 Algowikiadmin talk contribs created page 10.23 (Created page with " Back to Chapter 10")
  • 13:40, 21 September 2020 Algowikiadmin talk contribs created page 10.21 (Created page with " Back to Chapter 10")
  • 13:39, 21 September 2020 Algowikiadmin talk contribs created page 10.19 (Created page with " Back to Chapter 10")
  • 13:39, 21 September 2020 Algowikiadmin talk contribs created page 10.17 (Created page with " Back to Chapter 10")
  • 01:31, 21 September 2020 Algowikiadmin talk contribs created page 10.15 (Created page with " Back to Chapter 10")
  • 01:17, 21 September 2020 Algowikiadmin talk contribs created page 10.11 (Created page with "Answer to both a) and b) is no. Knapsack problem is NP-complete. ---- (a) Yes, this is a special case of the Knapsack problem where the value of each item is the same (desc...")
  • 01:17, 21 September 2020 Algowikiadmin talk contribs created page 10.13 (Created page with "==== 1 ==== # 20 x 1 # 1 x 6 + 14 x 1 # 2 x 6 + 8 x 1 # 3 x 6 + 2 x 1 # 1 x 10 + 10 x 1 # 1 x 10 + 1 x 6 + 4 x 1 # 2 x 10 ==== 2 ==== More generally: # there is always o...")
  • 01:16, 21 September 2020 Algowikiadmin talk contribs created page 10.9 (Created page with " Back to Chapter 10")
  • 01:16, 21 September 2020 Algowikiadmin talk contribs created page 10.7 (Created page with " Back to Chapter 10")
  • 01:15, 21 September 2020 Algowikiadmin talk contribs created page 10.1 (Created page with " Back to Chapter 10")
  • 01:15, 21 September 2020 Algowikiadmin talk contribs created page 10.5 (Created page with " Back to Chapter 10")
  • 01:15, 21 September 2020 Algowikiadmin talk contribs created page 10.3 (Created page with " Back to Chapter 10")
  • 01:13, 21 September 2020 Algowikiadmin talk contribs created page 7.43 (Created page with " Back to Chapter 7")
  • 01:13, 21 September 2020 Algowikiadmin talk contribs created page 7.41 (Created page with " Back to Chapter 7")
  • 01:13, 21 September 2020 Algowikiadmin talk contribs created page 7.39 (Created page with " Back to Chapter 7")
  • 01:12, 21 September 2020 Algowikiadmin talk contribs created page 7.37 (Created page with "Proof by induction. A tournament with 2 vertices (1,2) has a Hamiltonian path. 1 -> 2 or vice versa Now suppose our tournament with n vertices has a Hamiltonian path 1,..,n....")
  • 01:11, 21 September 2020 Algowikiadmin talk contribs created page 7.35 (Created page with " Back to Chapter 7")
  • 01:11, 21 September 2020 Algowikiadmin talk contribs created page 7.33 (Created page with " Back to Chapter 7")
  • 01:11, 21 September 2020 Algowikiadmin talk contribs created page 7.31 (Created page with " Back to Chapter 7")
  • 01:11, 21 September 2020 Algowikiadmin talk contribs created page 7.29 (Created page with " Back to Chapter 7")
  • 01:11, 21 September 2020 Algowikiadmin talk contribs created page 7.27 (Created page with " Back to Chapter 7")
  • 01:09, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 01:07, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 01:06, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 01:05, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 01:04, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 01:03, 21 September 2020 Algowikiadmin talk contribs created page 7.15 (Created page with " Back to Chapter 7")
  • 01:03, 21 September 2020 Algowikiadmin talk contribs created page 7.13 (Created page with " Back to Chapter 7")
  • 01:02, 21 September 2020 Algowikiadmin talk contribs created page 7.11 (Created page with " Back to Chapter 7")
  • 01:02, 21 September 2020 Algowikiadmin talk contribs created page 7.9 (Created page with " Back to Chapter 7")
  • 01:01, 21 September 2020 Algowikiadmin talk contribs created page 7.7 (Created page with " Back to Chapter 7")
  • 01:01, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 01:00, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 00:59, 21 September 2020 Algowikiadmin talk contribs created page 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,...")
  • 00:58, 21 September 2020 Algowikiadmin talk contribs created page 6.11 (Created page with " Back to Chapter 6")
  • 00:58, 21 September 2020 Algowikiadmin talk contribs created page 6.9 (Created page with " Back to Chapter 6")
  • 00:58, 21 September 2020 Algowikiadmin talk contribs created page 6.7 (Created page with " Back to Chapter 6")
  • 00:58, 21 September 2020 Algowikiadmin talk contribs created page 6.5 (Created page with " Back to Chapter 6")
  • 00:58, 21 September 2020 Algowikiadmin talk contribs created page 6.1 (Created page with " Back to Chapter 6")
  • 00:57, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 00:56, 21 September 2020 Algowikiadmin talk contribs created page 5.15 (Created page with " Back to Chapter 5")
  • 00:56, 21 September 2020 Algowikiadmin talk contribs created page 5.13 (Created page with " Back to Chapter 5")
  • 00:56, 21 September 2020 Algowikiadmin talk contribs created page 5.11 (Created page with " Back to Chapter 5")
  • 00:56, 21 September 2020 Algowikiadmin talk contribs created page 5.9 (Created page with " Back to Chapter 5")
  • 00:56, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 00:55, 21 September 2020 Algowikiadmin talk contribs created page 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] >...")
  • 00:54, 21 September 2020 Algowikiadmin talk contribs created page 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^...")
  • 00:53, 21 September 2020 Algowikiadmin talk contribs created page 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...")
  • 18:36, 20 September 2020 Algowikiadmin talk contribs created page 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...")
  • 18:36, 20 September 2020 Algowikiadmin talk contribs created page 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 Algowikiadmin talk contribs created page 4.49 (Created page with " Back to Chapter 4")
  • 18:34, 20 September 2020 Algowikiadmin talk contribs created page 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...")
  • 18:33, 20 September 2020 Algowikiadmin talk contribs created page 4.45 (Created page with " Back to Chapter 4")
  • 18:32, 20 September 2020 Algowikiadmin talk contribs created page 4.43 (Created page with " Back to Chapter 4")
  • 18:32, 20 September 2020 Algowikiadmin talk contribs created page 4.41 (Created page with " Back to Chapter 4")
  • 18:31, 20 September 2020 Algowikiadmin talk contribs created page 4.39 (Created page with " Back to Chapter 4")
  • 18:30, 20 September 2020 Algowikiadmin talk contribs created page 4.37 (Created page with " Back to Chapter 4")
  • 18:30, 20 September 2020 Algowikiadmin talk contribs created page 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...")
  • 18:30, 20 September 2020 Algowikiadmin talk contribs created page 4.33 (Created page with " Back to Chapter 4")
  • 18:29, 20 September 2020 Algowikiadmin talk contribs created page 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")
  • 18:28, 20 September 2020 Algowikiadmin talk contribs created page 4.29 (Created page with " Back to Chapter 4")
  • 18:28, 20 September 2020 Algowikiadmin talk contribs created page 4.27 (Created page with " Back to Chapter 4")
  • 18:28, 20 September 2020 Algowikiadmin talk contribs created page 4.25 (Created page with " Back to Chapter 4")
  • 18:28, 20 September 2020 Algowikiadmin talk contribs created page 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:...")
  • 18:27, 20 September 2020 Algowikiadmin talk contribs created page 4.21 (Created page with "the general form of this problem is to find the kth largest value. finding the median is when k = n/2. to find the kth largest value, * select a partition element and split...")
  • 18:26, 20 September 2020 Algowikiadmin talk contribs created page 4.19 (Created page with "1) Finding the maximum element is O(1) in both a max-heap (the root of the heap) and a sorted array (the last element in the array), so for this operation, both data structure...")
  • 18:25, 20 September 2020 Algowikiadmin talk contribs created page 4.17 (Created page with "Scan through the array to build an out-of-order heap, that is, the first element is indeed the smallest, but necessarily any of the other elements. This takes us O(n). Then ex...")
  • 18:25, 20 September 2020 Algowikiadmin talk contribs created page 4.15 (Created page with " Back to Chapter 4")
  • 18:25, 20 September 2020 Algowikiadmin talk contribs created page 4.13 (Created page with " Back to Chapter 4")
  • 18:24, 20 September 2020 Algowikiadmin talk contribs created page 4.11 (Created page with "Note that there can be at most one element which appears more than n/2 (i.e. at least ceil(n/2) ) times in the list. If we now consider the *sorted* version of the list, we'l...")
  • 18:23, 20 September 2020 Algowikiadmin talk contribs created page 4.9 (Created page with "Here the main thing to notice is that we need a O(<math>n^{k-1}logn</math>) solution. <br /> For various values of k, <br /> k Solution Time Complexity <br /> 1 O...")
  • 18:22, 20 September 2020 Algowikiadmin talk contribs created page 4.7 (Created page with " Back to Chapter 4")
  • 18:21, 20 September 2020 Algowikiadmin talk contribs created page 4.5 (Created page with "O(nlogn) solution: : sort the array first, : scan the array, keep updating a max_so_far counter. O(n) solution: : put each value into hash map with the value as key and fre...")
  • 18:20, 20 September 2020 Algowikiadmin talk contribs created page 4.3 (Created page with "<pre> Algo - If we create pair of (min1, max2n) (min1, max2n-1)... will provide optimal result 1) Sort the set of 2n element (n log n) 2) Now assign two pointers Start: A[...")
  • 18:20, 20 September 2020 Algowikiadmin talk contribs created page 4.1 (Created page with "Sort it with your favorite nlogn sorting algo. The bottom half is one team, the top half the other. Or much better , partition it with median as pivot . Time complexity O(n)...")
  • 18:18, 20 September 2020 Algowikiadmin talk contribs created page 3.45 (Created page with " == Using a Hashtable == Scan the web page word by word and for each one, except the first, take the pair formed by the previous word + the current one. Use that pair as the...")
  • 18:16, 20 September 2020 Algowikiadmin talk contribs created page 3.43 (Created page with "<pre> 1) Take two pointers Fast and Slow (Slow jumps one step at a time while Fast two step) 2) While (Fast != NULL) if(Fast == Slow) return true;...")
  • 18:14, 20 September 2020 Algowikiadmin talk contribs created page 3.41 (Created page with "Create a count sort in magazine until you find all the characters of given string. --Max 06:49, 25 June 2010 (EDT) Back to Chapter 3")
  • 18:14, 20 September 2020 Algowikiadmin talk contribs created page 3.39 (Created page with "== Iterative version with three variables == <pre> Node* ReverseList( Node * List ) { Node *temp1 = *List; Node * temp2 = NULL; Node * temp3 = NULL; while ( temp...")
  • 18:12, 20 September 2020 Algowikiadmin talk contribs created page 3.37 (Created page with "<pre> bool compare(struct node* a, struct node* b) { // 1. both empty -> true if (a==NULL && b==NULL) return(true); // 2. both non-empty -> compare them else if (a!...")
  • 18:10, 20 September 2020 Algowikiadmin talk contribs created page 3.35 (Created page with "Sort the shirts by color and do a binary search on color. Back to Chapter 3")
  • 18:09, 20 September 2020 Algowikiadmin talk contribs created page 3.33 (Created page with " Back to Chapter 3")
  • 18:08, 20 September 2020 Algowikiadmin talk contribs created page 3.31 (Created page with "Init: k=0 Insert X: k = k+1; A[X] = k; B[k] = X; Search X: return (A[X] < k) and (B[A[X]] == X) Delete X: A[B[k]] = A[X]; B[A[X]] = B[k]; k = k-1; Ple...")
  • 18:08, 20 September 2020 Algowikiadmin talk contribs created page 3.29 (Created page with "In each node of a binary tree store the sub tree sum for the left sub tree. #''Add'': while descending the tree to the left update the sub tree sum by adding the value #''Ins...")
  • 18:06, 20 September 2020 Algowikiadmin talk contribs created page 3.27 (Created page with "Let's put into the black box whole set <math>S=\{x_i\}_{i=1}^n</math>. If <math>bb(S)</math> is True, then such a subset exists and we can go on: # R:=S # for i:=1 to n do ##...")
  • 18:06, 20 September 2020 Algowikiadmin talk contribs created page 3.25 (Created page with " Back to Chapter 3")
  • 18:05, 20 September 2020 Algowikiadmin talk contribs created page 3.23 (Created page with " Back to Chapter 3")
  • 18:05, 20 September 2020 Algowikiadmin talk contribs created page 3.21 (Created page with "Since all the elements in S2 have keys larger than the keys of the elements in S1, those two trees can be subtrees of one tree whose root node will have a key larger than the...")
(newest | oldest) View ( | ) (20 | 50 | 100 | 250 | 500)