rtperson


Member since 05/23/2011

5 snippets

2834 profile views

0 Comment(s) Posted

View their favorites

their Tags


Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

rtperson's Recent Snippets



« Prev 1 Next »
Really DP-lite. Memoize the solution for a recursive problem so it can be looked up on subsequent iterations.
0 1795 posted 12 years ago by rtperson
You have to use float or double for the returned value, since the scale occurs in a continuous function.
0 1529 posted 12 years ago by rtperson
It's no fun implementing QuickSort unless you can force it out of its blister-fast, O(n log n) speed and humiliate it with its worst-case, O(n^2) runtime. So that's what I set out to do. My naive partition simply pivots around the low item, but...
0 834 posted 12 years ago by rtperson
Two versions of binary search -- one recursive, one iterative -- for an array of strings. Both assume that your array index fits within an integer.
0 1045 posted 12 years ago by rtperson
Check that a given integer consists only of elements of a given set. It does a linear search through the set, so the assumption is that the set to search is relatively small. If you're chewing through a particularly large set of digits, you may want...
0 1005 posted 13 years ago by rtperson
« Prev 1 Next »