Problem Detail: I’m reading about the Hindley-Milner typing algorithm while writing an implementation, and see that, as long as every variable is bound, you’ll always get either atomic types or types where the arguments will determine the final type, such as Read More …
Category: Uncategorized
[Solved]: Creating a binomial heap from an array in Θ(n) time
Problem Detail: I’m studying binomial heaps. A book tells me that insertion of a node to a binomial heap take $Theta(log n)$ time. So given an array of $n$ elements it would take $Theta(n log n)$ time to convert it to Read More …
[Solved]: How do I structure hexagon edge data?
Problem Detail: In my program, it draws them by offsetting every other row by half of the width, as pictured above. Each tile can be referenced by coordinates, also shown above. I want to know how many blue tiles are Read More …
[Solved]: Memoized Palindrome Subsequence
Problem Detail: I am trying to find the maximum palindrome sub-sequence and after going through some tutorials, I came up with a memoized version.But I am not sure about the runtime.I want to know if the following algorithm will work.Could also Read More …
[Solved]: What classes of data structures can be made persistent?
Problem Detail: Persistent data structures are immutable data structures. Operations on them return a new “copy” of the data structure, but altered by the operation; the old data structure remains unchanged though. Efficiency is generally accomplished by sharing some of the Read More …
[Solved]: Online Learning Resources for Discrete Mathematics
Problem Detail: Are there any good Discrete mathematics learning web resources with problem sets? Asked By : violet kiwi Answered By : blah I have the perfect place for you, I really enjoyed it myself: Discrete Mathematics lecture series on infocobuild Everything I Read More …
[Solved]: Given $k$ sorted lists, $O(n log k)$ complexity, Mergesort rather than Heapsort
Problem Detail: I was convinced that my idea for a solution to sort $k$ sorted lists into one list would work with a ‘variation’ on MergeSort. I was told this would not work and had to use Heapsort, but didn’t get Read More …
[Solved]: Proof by Reduction: From Empty Language to Halting Problem on Empty Input
Problem Detail: Question: Let language $E$ = {$langle M rangle$ | $M$ accepts no inputs whatsoever} Let language $H$ = { $langle M rangle$ | $M$ halts on an empty string input}. Is it possible to show that $H$ is undecidable Read More …
[Solved]: Is there a known method for constructing a grammar given a finite set of finite strings?
Problem Detail: From my reading it seems that most grammars are concerned with generating an infinite number of strings. What if you worked the other way around? If given n strings of m length, it should be possible to make a Read More …
[Solved]: Hash function floating point inputs for genetic algorithm
Problem Detail: I am implementing a genetic algorithm to use as an optimisation algorithm to evolve robots. The robots have certain parameters (represented as floats) which can lie anywhere within a certain range defined for each parameter. My goal is to Read More …