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).
(newest | oldest) View (newer 100 | older 100) (20 | 50 | 100 | 250 | 500)- 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...")
- 18:04, 20 September 2020 Algowikiadmin talk contribs created page 3.19 (Created page with "Store two values, the maximum and minimum. These need to be checked and potentially updated on every delete. If the minimum is being deleted, call the successor, update the...")
- 18:03, 20 September 2020 Algowikiadmin talk contribs created page 3.17 (Created page with " Back to Chapter 3")
- 18:03, 20 September 2020 Algowikiadmin talk contribs created page 3.15 (Created page with " Back to Chapter 3")
- 18:02, 20 September 2020 Algowikiadmin talk contribs created page 3.13 (Created page with " Back to Chapter 3")
- 18:02, 20 September 2020 Algowikiadmin talk contribs created page 3.11 (Created page with "Since 1,2,...,n is finite, use a bit array to represent them.<br> See the telephone number sorting example in Column 1 of <Programming Pearls> (Jon Bentley) for detailed expla...")
- 18:00, 20 September 2020 Algowikiadmin talk contribs created page 3.9 (Created page with " Back to Chapter 3")
- 17:59, 20 September 2020 Algowikiadmin talk contribs created page 3.7 (Created page with " Back to Chapter 3")
- 17:59, 20 September 2020 Algowikiadmin talk contribs created page 3.5 (Created page with "1. size 4 array with 3 elements. remove 1, insert 1, and so forth. <br> 2. when the array is one-fourth full, shrink its size to half of what it was. Back to Chaprer 3")
- 17:57, 20 September 2020 Algowikiadmin talk contribs created page 3.3 (Created page with "'''C''' <pre> typedef struct Node { char *value; struct Node *next; } Node; int reverse(Node **head) { Node *curr, *prev, *next; if (!head || !(*head)) {...")
- 17:56, 20 September 2020 Algowikiadmin talk contribs created page 3.1 (Created page with "You just need to maintain a count, like so: <pre> public static boolean isBalanced(String str) { int count = 0; for (int i = 0, n = str.length(); i < n;...")
- 22:09, 11 September 2020 Algowikiadmin talk contribs created page 11.35 (Created page with " Back to Chapter 11")
- 22:07, 11 September 2020 Algowikiadmin talk contribs created page 11.33 (Created page with " Back to Chapter 11")
- 22:06, 11 September 2020 Algowikiadmin talk contribs created page 11.31 (Created page with " Back to Chapter 11")
- 22:06, 11 September 2020 Algowikiadmin talk contribs created page 11.29 (Created page with " Back to Chapter 11")
- 22:06, 11 September 2020 Algowikiadmin talk contribs created page 11.27 (Created page with " Back to Chapter 11")
- 19:23, 11 September 2020 Algowikiadmin talk contribs created page 11.25 (Created page with " Back to Chapter 11")
- 19:22, 11 September 2020 Algowikiadmin talk contribs created page 11.23 (Created page with " Back to Chapter 11")
- 19:21, 11 September 2020 Algowikiadmin talk contribs created page 11.21 (Created page with " Back to Chapter 11")
- 19:18, 11 September 2020 Algowikiadmin talk contribs created page 11.13 (Created page with " Back to Chapter 11")
- 19:18, 11 September 2020 Algowikiadmin talk contribs created page 11.19 (Created page with " Back to Chapter 11")
- 19:18, 11 September 2020 Algowikiadmin talk contribs created page 11.17 (Created page with " Back to Chapter 11")
- 19:16, 11 September 2020 Algowikiadmin talk contribs created page 11.15 (Created page with " Back to Chapter 11")
- 21:45, 10 September 2020 Algowikiadmin talk contribs created page 11.11 (Created page with " Back to Chapter 11")
- 21:35, 10 September 2020 Algowikiadmin talk contribs created page 11.9 (Created page with " Back to Chapter 11")
- 21:35, 10 September 2020 Algowikiadmin talk contribs created page 11.7 (Created page with " Back to Chapter 11")
- 21:35, 10 September 2020 Algowikiadmin talk contribs created page 11.5 (Created page with " Back to Chapter 11")
- 21:34, 10 September 2020 Algowikiadmin talk contribs created page 11.3 (Created page with " Back to Chapter 11")
- 21:34, 10 September 2020 Algowikiadmin talk contribs created page 11.1 (Created page with " Back to Chapter 12")
- 21:11, 10 September 2020 Algowikiadmin talk contribs created page 12.19 (Created page with " Back to Chapter 12")
- 21:11, 10 September 2020 Algowikiadmin talk contribs created page 12.21 (Created page with " Back to Chapter 12")
- 21:11, 10 September 2020 Algowikiadmin talk contribs created page 12.17 (Created page with " Back to Chapter 12")
- 21:11, 10 September 2020 Algowikiadmin talk contribs created page 12.15 (Created page with " Back to Chapter 12")
- 21:10, 10 September 2020 Algowikiadmin talk contribs created page 12.13 (Created page with " Back to Chapter 12")
- 21:09, 10 September 2020 Algowikiadmin talk contribs created page 12.11 (Created page with " Back to Chapter 12")
- 21:09, 10 September 2020 Algowikiadmin talk contribs created page 12.9 (Created page with " Back to Chapter 12")
- 21:09, 10 September 2020 Algowikiadmin talk contribs created page 12.7 (Created page with " Back to Chapter 12")
- 21:08, 10 September 2020 Algowikiadmin talk contribs created page 12.5 (Created page with " Back to Chapter 12")
- 21:08, 10 September 2020 Algowikiadmin talk contribs created page 12.3 (Created page with " Back to Chapter 12")
- 21:08, 10 September 2020 Algowikiadmin talk contribs created page 12.1 (Created page with " Back to Chapter 12")
- 20:01, 10 September 2020 Algowikiadmin talk contribs created page 2.21 (Created page with " Back to Chapter 2")
- 20:00, 10 September 2020 Algowikiadmin talk contribs created page 2.19 (Created page with " Back to Chapter 2")
- 20:00, 10 September 2020 Algowikiadmin talk contribs created page 2.25 (Created page with " Back to Chapter 2")
- 19:59, 10 September 2020 Algowikiadmin talk contribs created page 2.23 (Created page with " Back to Chapter 2")
- 19:59, 10 September 2020 Algowikiadmin talk contribs created page 2.27 (Created page with " Back to Chapter 2")
- 19:58, 10 September 2020 Algowikiadmin talk contribs created page 2.29 (Created page with " Back to Chapter 2")
- 19:57, 10 September 2020 Algowikiadmin talk contribs created page 2.31 (Created page with " Back to Chapter 2")
- 19:57, 10 September 2020 Algowikiadmin talk contribs created page 2.33 (Created page with " Back to Chapter 2")
- 19:56, 10 September 2020 Algowikiadmin talk contribs created page 2.35 (Created page with " Back to Chapter 2")
- 19:55, 10 September 2020 Algowikiadmin talk contribs created page 2.37 (Created page with "On careful observation , one can see that the sum of any row is just <math>3^{n-1}</math> this is the sum for the series . This can even be computed using a series as shown b...")
- 19:54, 10 September 2020 Algowikiadmin talk contribs created page 2.39 (Created page with " Back to Chapter 2")
- 19:53, 10 September 2020 Algowikiadmin talk contribs created page 2.41 (Created page with " Back to Chapter 2")
- 19:51, 10 September 2020 Algowikiadmin talk contribs created page 2.43 (Created page with "X=n-digit number (abcdefghijklmn), y= n-digit number (ABCDEFGHIJKLMN) say X * y = X * N + X * M0 + X * L00 + X * K000 + .... + X * B000000000000 + X * A0000000000000 With ea...")
- 19:51, 10 September 2020 Algowikiadmin talk contribs created page 2.45 (Created page with " Back to Chapter 2")
- 19:45, 10 September 2020 Algowikiadmin talk contribs created page 2.47 (Created page with "Change the assumptions of the proof. The paper mentioned is "S. Skiena. Encroaching lists as a measure of presortedness. BIT, 28:775-784, 1988." '''Other solution :''' <m...")
- 19:44, 10 September 2020 Algowikiadmin talk contribs created page 2.49 (Created page with " Back to Chapter 2")
- 19:43, 10 September 2020 Algowikiadmin talk contribs created page 2.51 (Created page with "<pre> 1) Find an empty bag (labeled "E") 2) Place 1 coin from bag 1 into E 3) Place 2 coins from bag 2 into E ... 10) Place 9 coins from bag 9 into E 11) Place 10 coins from b...")
- 19:43, 10 September 2020 Algowikiadmin talk contribs created page 2.53 (Created page with "Some incorrect answers were reached. These have been moved to the discussion, with explanation of where the argument goes wrong. The correct answer: Assuming pairwise merges...")
- 19:41, 10 September 2020 Algowikiadmin talk contribs created page 2.55 (Created page with "This problem is a famous game-theoretical scenario called the pirate game (http://en.wikipedia.org/wiki/Pirate_game). Assume the senior pirate gets to vote. Where there is on...")
- 19:41, 10 September 2020 Algowikiadmin talk contribs created page 2.17 (Created page with " Back to Chapter 2")
- 19:40, 10 September 2020 Algowikiadmin talk contribs created page 2.15 (Created page with " Back to Chapter 2")
- 19:39, 10 September 2020 Algowikiadmin talk contribs created page 2.13 (Created page with "because <math> n^2 <= 2^n </math> for every n greater than 4 . Hence, we can say that <math> n^2 < = C* 2^n </math> for every n>=4 and so <math> n^2 = O(2^n)</math>. Back t...")
- 19:38, 10 September 2020 Algowikiadmin talk contribs created page 2.11 (Created page with " Back to Chapter 2")
- 18:53, 9 September 2020 Algowikiadmin talk contribs created page 2.9 (Created page with "=2-8.= For each of the following pairs of functions, either <math>f(n)</math> is in <math>O(g(n))</math>, <math>f(n)</math> is in <math>\Omega(g(n))</math>, or <math>f(n)=\Th...")
- 18:51, 9 September 2020 Algowikiadmin talk contribs created page 2.7 (Created page with "'''n = 1''' The single element array is already its max. Loop is not entered. Max is returned Let for '''n=k''', the algorithm is true For '''n = k+1''' ,two cases arise :...")
- 18:50, 9 September 2020 Algowikiadmin talk contribs created page 2.5 (Created page with " Back to Chapter 2")
- 18:49, 9 September 2020 Algowikiadmin talk contribs created page 2.3 (Created page with "<math>f(n) = (((n^2)(n+1)^2)/8) + n(n+1)(2n+1)/12</math> ---- This problem does appear to break down into a series of nested summations: <math> \displaystyle\sum_{i=1}^{n}\te...")
- 19:25, 8 September 2020 Algowikiadmin talk contribs created page 2.1 (Created page with " This loop can be expressed as the sum: <math> \sum_{i=1}^{n-1}\sum_{j=i+1}^{n}\sum_{k=1}^{j}1 </math> Reducing this, sum by sum from the rhs: <math> \begin{align} &\sum_{i...")
- 12:25, 1 September 2020 Algowikiadmin talk contribs created page 1.37 (Created page with "I'm envisioning the United States as a rectangle 1000 miles high and 3000 miles long. I'm not including Alaska, because, although it's large, it doesn't have many roads. Much...")
- 12:25, 1 September 2020 Algowikiadmin talk contribs created page 1.35 (Created page with "'''Assumptions''': : approx 400000 cars : each car needs to refuel once a week : each gas station is open 10 hours a day and refuels 10 cars an hour : there are enough station...")
- 12:23, 1 September 2020 Algowikiadmin talk contribs created page 1.33 (Created page with " Answer: Seven races. '''First 5 races:''' Divide 25 horses into 5 groups and that gives you 5 winners. '''Sixth race:''' Now race 5 of them that will give you winner and wh...")
- 12:21, 1 September 2020 Algowikiadmin talk contribs created page 1.31 (Created page with "Back to Chapter 1.")
- 12:20, 1 September 2020 Algowikiadmin talk contribs created page 1.19 (Created page with "<b>Step 1:</b> Show that the statement holds for the basis case <math>n = 1</math><br> :<math>E(n) = n - 1</math><br> :<math>E(1) = 1 - 1 = 0</math>. A tree with one node has...")
- 12:19, 1 September 2020 Algowikiadmin talk contribs created page 1.17 (Created page with "<b>Step 1:</b> Show that the statement holds for the basis case <math>n = 1</math><br> :<math>\frac {1}{i(i+1)} = \frac {n}{n+1}</math><br><br> :<math>\frac {1}{1(1+1)} = \fr...")
- 12:18, 1 September 2020 Algowikiadmin talk contribs created page 1.15 (Created page with "Call the statement <math>S_n</math> and the general term <math>a_n</math><br> <b>Step 1:</b> Show that the statement holds for the basis case <math>n = 0</math><br> :<math>a...")
- 12:18, 1 September 2020 Algowikiadmin talk contribs created page 1.13 (Created page with "The basis case is when <math>n = 0</math><br> :<math>\sum_{i=1}^0 i^2 = 0^2 = 0 </math><br> and using <math>n=0</math> in the formula <math>\frac {n(n + 1)(2 \cdot n + 1)} {6}...")
- 12:15, 1 September 2020 Algowikiadmin talk contribs created page 1.27 (Created page with "Return to Chapter 1.")
- 12:07, 1 September 2020 Algowikiadmin talk contribs created page 1.29 (Created page with "1. If there are 10 times as many items, and it is proportional to <math>n^2</math>, it will take <math>10^2</math> times as long or 100 seconds. 2. If it proportional to <math...")
- 12:06, 1 September 2020 Algowikiadmin talk contribs created page 1.25 (Created page with "I estimate the mouth of the Mississippi at 1 mile wide and 100 feet, or 0.02 miles, deep. If the water were moving at 10 miles an hour, that means that 10 miles x 0.02 miles x...")
- 12:04, 1 September 2020 Algowikiadmin talk contribs created page 1.23 (Created page with "1 million seconds = 277.777778 hours 1 million seconds = 11.5740741 days ---- Possible approach: a) There are 3600s in an hour b) Eliminating the thousands, we get 1000...")
- 12:03, 1 September 2020 Algowikiadmin talk contribs created page 1.21 (Created page with "Back to Chapter 1.")