摘要:
很容易联想到 at most distinct k 等一连串sliding window的问题,但是真正做起来发现困难重重。 具体来说,通过sliding window我们的确可以得到一个个以a[i]结尾的,exactly k个不同元素的最长window。但是我们很难求出这样的window中一共有多 阅读全文
摘要:
The reader and writer processes share the following data structures: semaphore rw_mutex = 1; semaphore mutex = 1; int read_count = 0; The semaphores m 阅读全文
摘要:
Quicksort not stable in place faster than other sorting algorithms for small data set Quickselect quickselect is a selection algorithm to find the kth 阅读全文
摘要:
Reservoir sampling is a family of randomized algorithms for randomly choosing k samples from a list of n items, where n is either a very large or unkn 阅读全文
摘要:
Hash Function: A function that converts a given big phone number to a small practical integer value. The mapped integer value is used as an index in h 阅读全文
摘要:
Operating systems often distinguish between counting and binary semaphores. The value of a counting semaphore can range over an unrestricted domain. T 阅读全文