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
ListOfAlgorithms = new Algorithm[](initialAlgorithmCoeffcients) | |
foreach dataset in datasets | |
foreach algorithm in ListOfAlgorithms | |
// do a trial on a dataset | |
algorithm.apply(dataset) | |
//score how the algorithms did | |
algorithm.score = ScoringFunction(algorithm.result) | |
//good algorithms live, bad ones die | |
if algorithm.score > GOOD_CUTOFF | |
algorithm.duplicate(); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
//Problem: |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
using Newtonsoft.Json.Utilities; | |
namespace ConsoleApplication1 | |
{ |
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
teleports = {1:38, 4:14, 9:31, 16:6, 21:42, 36:44, 47:26, 49:11, 51:67, 56:53, 62:19, 64:60, 71:91, 80:100, 87:24, 93:73, 95:75, 98:78} | |
board = [[] for i in range(101)] | |
def getPossibleNextSquares(x): | |
nextSquares = [] | |
for i in range(1, 7): | |
if x + i in teleports.keys(): | |
nextSquares.append(teleports[x+i]) | |
elif x + i >= 101: |
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
edges = [( 0,22),( 0,39),( 0,47),( 1, 5),( 2,38),( 2,39),( 2,44),( 4,23),( 4,33), | |
( 5,19),( 6,17),( 6,35),( 6,45),( 7,49),( 8,24),( 8,40),( 9,25),( 7,10), | |
(10,11),(10,21),(11,30),(12,32),(13,27),(14,33),(14,36),(15,49),(16,48), | |
(18,37),(18,45),(19,24),(19,40),(20,39),(21,34),(25,36),(26,27),(26,31), | |
(26,32),(28,48),(29,36),(29,41),(35,43),(38,42),(39,44),(43,46),(48,49)] | |
class PointCollection: | |
members = set([]) | |
masterDictionary = {} | |
distinctList = [] |
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
tensPlaceStrings = { 2:"Twenty", 3:"Thirty", 4:"Forty", 5:"Fifty", 6:"Sixty", 7:"Seventy", 8:"Eighty", 9:"Ninety"} | |
oneToNineteenStrings = {1:"One", 2:"Two", 3:"Three", 4:"Four", 5:"Five", 6:"Six",7:"Seven",8:"Eight",9:"Nine", | |
10:"Ten",11:"Eleven", 12:"Twelve", 13:"Thirteen", 14:"Fourteen", 15:"Fifteen", 16:"Sixteen", | |
17:"Seventeen", 18:"Eighteen", 19:"Nineteen"} | |
def bottlePlural(num): | |
if num != 1: | |
return "bottles" | |
else: | |
return "bottle" |
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
Create a data structure for each box | |
* Data about the box itself (x,y,z) (name?) | |
* bestDepth (initialize to 1) | |
* bestBox (initialize to null) | |
Sort Boxes ascending by size (x * y * z) (NLogN) | |
Starting with the smallest box: | |
Compare backwards with all smaller boxes. |
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
For Each Box: | |
Compare to all other boxes, | |
Create a list of boxes that could fit inside it (one layer only) | |
(N^2), | |
For each box, create a data structure that includes the box itself, an int bestCount and another box bestBox | |
Sort the boxes by size (N Log N). | |
Iterate through the boxes started with the smallest | |
If a box doesn't contain any boxes give it bestCount 1, and bestbox Null |