Skip to content

Instantly share code, notes, and snippets.

/**
----------------------------------------------------------------
Play Melody by Touch
written by victoria wu
summer 2012
Cycle through a melody using a touch sensor.
Uses CapSense libarry - http://www.arduino.cc/playground/Main/CapSense
----------------------------------------------------------------
*/
Sorting ... Increasing!
===========================
Size: 100
Timsort: 4.53219e-005
mergesort: 0.0014503
Size: 1000
Timsort: 2.07324e-005
mergesort: 0.0151718
for(int i =0; i < size; i++)
{
//fin >> temp;
hello[i] = i;
if(i < 100)
data.push_back(temp);
}
Before mergify
1 2 3 3 5 7 8 9 16 21 22 23 1 2 2 10 11 13 15 16 17 18 20 24 25
after mergify
1 1 2 2 2 3 3 5 7 8 9 10 11 13 15 16 16 17 18 20 21 22 23 24 25
@vcwu
vcwu / gist:3086215
Created July 10, 2012 21:03
Playing Music
// Buzzer example function for the CEM-1203 buzzer (Sparkfun's part #COM-07950).
// by Rob Faludi
// http://www.faludi.com
// Additions by Christopher Stevens
// http://www.christopherstevens.cc
//Taken from http://www.instructables.com/id/Play-the-French-Can-Can-Using-an-Arduino-and-Buzze/step8/Play-Musical-Notes/
/**
Victoria Wu
CS 352
Treap
An implementation of a binary search tree that incorporates properties of a heap,
preventing an overly imbalanced tree.
*/
for(int i =10000; i<= 160000; i*=2)
{
Treap<Student>* time = new Treap<Student>();
Student hello;
for(int x = 0; x < i; x++)
{
hello = Student(x);
time->insert(hello);
cout << "Finding Min Stuff " << endl << endl;
for(int i =100000; i<= 1600000; i*=2)
{
Treap<Student>* time = new Treap<Student>();
Student hello;
for(int x = 0; x < i; x++)
{
for(int i =10000; i<= 160000; i*=2)
{
Treap<Student>* time = new Treap<Student>();
Student hello;
for(int x = 0; x < i; x++)
{
hello = Student(x);
time->insert(hello);
for(int i =10000; i<= 160000; i*=2)
{
Treap<int>* time = new Treap<int>();
begin = clock();
for(int x = 0; x < i; x++)
{
time->insert(x);
}
end = clock();