Skip to content

Instantly share code, notes, and snippets.

@ferristseng
ferristseng / main.rs
Last active August 29, 2015 14:18
MaxHeap practice...
use std::mem::{swap};
use std::fmt::{Debug};
struct MaxHeap<T> {
inner: Vec<T>
}
impl<T> MaxHeap<T> where T: PartialOrd<T> + Debug {
#[inline]
fn new() -> MaxHeap<T> {
@ferristseng
ferristseng / gist:6396255
Created August 31, 2013 04:43
transform a dictionary of url parameters into a string
def parse_options(opts):
if opts:
return '?%s' % '&'.join(['%s=%s' % (k, v) for (k, v) in opts.iteritems()])
return ''