User contributions
Jump to navigation
Jump to search
- 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
- 18:27, 20 September 2020 diff hist +992 N 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..." current
- 18:26, 20 September 2020 diff hist +900 N 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..." current
- 18:25, 20 September 2020 diff hist +539 N 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..." current
- 18:25, 20 September 2020 diff hist +23 N 4.15 Created page with " Back to Chapter 4" current
- 18:25, 20 September 2020 diff hist +23 N 4.13 Created page with " Back to Chapter 4" current
- 18:24, 20 September 2020 diff hist +3,256 N 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..." current
- 18:23, 20 September 2020 diff hist -19 4.9 current
- 18:23, 20 September 2020 diff hist +3,167 N 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 diff hist +23 N 4.7 Created page with " Back to Chapter 4" current
- 18:21, 20 September 2020 diff hist +250 N 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..." current