- (10 pts) Suppose we are comparing implementations of two different sorting algorithms, insertion sort and merge sort. For inputs of size n, insertion sort runs in 8n2 steps, while merge sort requires 64n lg n steps. For which values of n does insertion sort beat merge sort.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
import random | |
from numpy import sign as sgn | |
score= 0 | |
chandr=20 | |
decayRate = 100 # higher is slower | |
spew = .1 | |
leng=-100 | |
gconst = 1 |
#Impacts of Noise Distortion and Interference
#Waveform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PseudoCode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct UpperLower { | |
int shortest_dah; | |
int longest_dit; | |
}; | |
/** | |
* @author Jonathan Wheeler | |
* @date 11 February 2016 | |
* | |
* Accepts a digital input taken from a photodiode. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Pragma: public"); | |
header("Expires: 0"); | |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
header("Content-Type: application/force-download"); | |
header("Content-Type: application/octet-stream"); | |
header("Content-Type: application/download"); | |
header("Content-Disposition: attachment;filename=email.txt"); | |
header("Content-Transfer-Encoding: binary "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check to see if raspbian exists on hard drive | |
ls *raspbian*.img >/dev/null 2> /dev/null | |
if [ "$?" -eq "1" ]; then | |
# file not found | |
raspbianFileName='raspbian.img' | |
else | |
# file found | |
raspbianFileName=$(ls *raspbian*.img | head -n1) > /dev/null | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
// Power pin is normally OFF | |
// Walk pin is normall ON | |
int walkPin = 2; | |
int powerPin = 3; | |
int togglePin = 3; | |
int bellPin = 12; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def combine(*args): | |
if len(args) == 2: | |
return np.concatenate([(x*y, x+y, abs(x-y), x/y, y/x) for x in args[0] for y in args[1]]) | |
return np.concatenate([combine(combine(*np.roll(args, i)[1:]), np.roll(args,i)[0]) for i in range(len(args))]) | |
vals = (np.arange(10) + 1).astype(np.float64) | |
for x in ("%i %i %i %i, %s" % (a,b,c,d, 24 in combine([a], [b], [c], [d])) for a in vals for b in vals for c in vals for d in vals if a <= b and b <= c and c <= d ): | |
print(x) | |
import numpy as np | |
def combine(*args): |
OlderNewer