Age | Commit message (Collapse) | Author | Files | Lines |
|
As with most linked list questions, this one involves an arcane trick from the
neck-bearded playbook.
|
|
Write a function to modify an array of integers in-place such that all of the
zeroes in the array are at the end, and the order of the other integers is not
changed.
|
|
After seeing the solution that my book advocated, I implemented it using
recursion.
|
|
Write a random number generator for [0,7) using only a random number generator
for [0,5). Ensure the results are uniformly distributed.
|
|
This solution operates in O(n) time instead of O(n*log(n)) time, which
surprisingly isn't *that* big of a difference...
Consider a size of n of 10M...
1) ~10s
2) ~0.5s
So, yes, the O(n*log(n)) will take 100x longer to complete, but for an enormous
input size of 10M elements, it can still complete in under a minute. The
difference between that and the second, faster, algorithm, is just 9s.
|
|
Write a function that returns the indices demarcating a substring, which if
sorted, would make the entire array sorted.
|
|
Defining the insert (or "siftup") function described in the "Programming Pearls"
book.
|
|
Write a function that reads a string of compressed XML and outputs the
decompressed version.
Note to self: Now that I'm growing more comfortable writing parsers, I'd like to
become equally comfortable writing pretty-printers.
|
|
Write a function that verifies whether or not a tic-tac-toe board is valid.
|
|
Write a function to compute the highest stack of boxes that can be created from
a list of boxes.
|
|
After a five year hiatus, I decided to attempt to solve the famous N queens
problem again. This time, instead of modeling the chess board using a
`[[Bool]]`, I'm using `[Integer]` where the `Integer` indicates which column has
a queen. This is a bit lighter in RAM.
|
|
Adding some documentation for my future self.
|
|
Add attempts at solving coding problems to Briefcase.
|