Is Disney’s FastPass Valid and/or Useful Queue Theory

It’s about accumulation, not queue efficiency. Fastpass works because it makes the individual items in the queue more efficient in “consuming” something. It’s not so much a queue like a processor waiting for instructions to execute as it is people waiting in line for food. In the case of people at Disneyland, it allows them … Read more

Kotlin – Idiomatic way to remove duplicate strings from array?

Use the distinct extension function: val a = arrayOf(“a”, “a”, “b”, “c”, “c”) val b = a.distinct() // [“a”, “b”, “c”] There’s also distinctBy function that allows one to specify how to distinguish the items: val a = listOf(“a”, “b”, “ab”, “ba”, “abc”) val b = a.distinctBy { it.length } // [“a”, “ab”, “abc”] As … Read more

Diff Algorithm? [closed]

An O(ND) Difference Algorithm and its Variations (1986, Eugene W. Myers) is a fantastic paper and you may want to start there. It includes pseudo-code and a nice visualization of the graph traversals involved in doing the diff. Section 4 of the paper introduces some refinements to the algorithm that make it very effective. Successfully … Read more

Nearest neighbors in high-dimensional data?

I currently study such problems — classification, nearest neighbor searching — for music information retrieval. You may be interested in Approximate Nearest Neighbor (ANN) algorithms. The idea is that you allow the algorithm to return sufficiently near neighbors (perhaps not the nearest neighbor); in doing so, you reduce complexity. You mentioned the kd-tree; that is … Read more