This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
public class FindInBST { | |
public static Node<T> findValueInBST(T value, Node<T> root) { | |
checkNotNull(value); | |
//terminating condition | |
if (root == null) { | |
return null; | |
} | |
//Find mode in sorted array | |
/* | |
What types? Let's assume int for now. | |
Bounds on underlying data? No bounds beyond underlying int type | |
Know anything about the distribution. Nope. Anything and everything, but the array is monotonically increasing. | |
What bounds on array size? Let's not concern ourselves. Sufficiently | |
small that we can work with the array in memory. | |
*/ |
package io.tense.interview.arrays; | |
import static com.google.common.base.Preconditions.checkNotNull; | |
public class CircularArrays { | |
/** | |
* Tests for the the complete "circularity" of an array of integers where | |
* traversal is performed by taking array[i] and summing the index i and | |
* value stored in the array to derive a new index. |
Source | Target | Type | Id | Weight | Average Degree | |
---|---|---|---|---|---|---|
1 | 3 | Undirected | 1 | 1.0 | 1.0 | |
2 | 10 | Undirected | 8 | 1.0 | 1.0 | |
3 | 4 | Undirected | 2 | 1.0 | 1.0 | |
4 | 5 | Undirected | 3 | 1.0 | 1.0 | |
5 | 10 | Undirected | 4 | 1.0 | 1.0 | |
8 | 2 | Undirected | 7 | 1.0 | 1.0 | |
8 | 9 | Undirected | 11 | 1.0 | 1.0 | |
10 | 1 | Undirected | 5 | 1.0 | 1.0 | |
10 | 6 | Undirected | 10 | 1.0 | 1.0 |
# Histogram filter for 2D discrete world | |
# author: Erik Hollembeak | |
colors = [['red', 'green', 'green', 'red', 'red'], | |
['red', 'red', 'green', 'red', 'red'], | |
['red', 'red', 'green', 'green', 'red'], | |
['red', 'red', 'red', 'red', 'red']] | |
measurements = ['green', 'green', 'green', 'green', 'green'] |
(defun divisible-by (number list) | |
"return true if divisible by an element in the list" | |
(loop for i in list | |
thereis (= (mod number i) 0))) | |
(defun prime-list-generator (current max-value prime-list) | |
"business end of p10" | |
(if (= current max-value) | |
prime-list | |
(if (divisible-by current prime-list) |
;(compile-file "euler.lisp") | |
(defun fib (n) | |
(if (or (= n 0) | |
(= n 1)) | |
1 | |
(+ (fib (- n 1)) | |
(fib (- n 2))))) | |
(defun square (number) |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
garbageDetector.py | |
Created by Erik Hollembeak on 2009-09-28. | |
Copyright (c) 2009 Vocalocity. All rights reserved. | |
""" | |
import sys |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
Alan Kay's talk at Creative Think seminar, July 20, 1982 | |
Outline of talk: Metaphors, Magnetic Fields, Snobbery and Slogans | |
The best way to predict the future is to invent it. | |
Humans like fantasy and sharing: | |
Fantasy fulfills a need for a simpler, more controllable world. | |
Sharing is important - we're all communication junkies. We have an incredible bandwidth |