This file contains hidden or 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 java.util.Queue; | |
import java.util.LinkedList; | |
/** | |
* Binary Tree Stub for Recitation | |
* @author khayyamsaleem | |
*/ | |
public class BinaryTree<E extends Comparable<E>>{ | |
Node<E> root; //root of the whole tree |
This file contains hidden or 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 java.util.AbstractQueue; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.Comparator; | |
import java.util.Queue; | |
/** | |
* The Heap implements the Queue interface | |
* by building a heap in an ArrayList. The heap is structured | |
* so that the "smallest" item is at the top. | |
* @author Koffman and Wolfgang |
This file contains hidden or 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 java.util.ArrayList; | |
import java.util.Collections; | |
/** | |
* Java implementation of a minHeap <br> | |
* Challenge (not really): convert to maxHeap <br> | |
* Challenge: implement a swap function for arraylists | |
* so that we don't have to import Collections <br> | |
* Challenge: use an Array instead of an ArrayList (hard) <br> | |
* Challenge: rewrite toString to prettyPrint a heap | |
* @author: Khayyam Saleem |
This file contains hidden or 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
%Khayyam Saleem and Ryan Edelstein | |
%CS511 Quiz 6 | |
%We pledge our honors that we have abided by the Stevens Honor System. | |
-module(tree_quiz). | |
-compile(export_all). | |
b_and(true, true) -> true; | |
b_and(_, _) -> false. | |
tSize({empty}) -> 0; |
This file contains hidden or 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 java.util.Queue; | |
import java.util.ArrayList; | |
import java.util.LinkedList; | |
public class BinaryTree<E extends Comparable<E>>{ | |
Node<E> root; //root of the whole tree | |
/** | |
* inner node class for BTs | |
*/ |
This file contains hidden or 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
-module(interp). | |
-export([scanAndParse/1,runFile/1,runStr/1,scanAndParseString/1]). | |
-include("types.hrl"). | |
loop(InFile,Acc) -> | |
case io:request(InFile,{get_until,prompt,lexer,token,[1]}) of | |
{ok,Token,_EndLine} -> | |
loop(InFile,Acc ++ [Token]); | |
{error,token} -> | |
exit(scanning_error); |
This file contains hidden or 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
-module(env). | |
-compile(export_all). | |
-include("types.hrl"). | |
-spec new()-> envType(). | |
new() -> | |
[]. | |
-spec add(envType(),atom(),valType())-> envType(). |
This file contains hidden or 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
-module(interp). | |
-export([scanAndParse/1,runFile/1,runStr/1,scanAndParseString/1]). | |
-include("types.hrl"). | |
loop(InFile,Acc) -> | |
case io:request(InFile,{get_until,prompt,lexer,token,[1]}) of | |
{ok,Token,_EndLine} -> | |
loop(InFile,Acc ++ [Token]); | |
{error,token} -> | |
exit(scanning_error); |
This file contains hidden or 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
-module(interp). | |
-export([scanAndParse/1,runFile/1,runStr/1,scanAndParseString/1]). | |
-include("types.hrl"). | |
loop(InFile,Acc) -> | |
case io:request(InFile,{get_until,prompt,lexer,token,[1]}) of | |
{ok,Token,_EndLine} -> | |
loop(InFile,Acc ++ [Token]); | |
{error,token} -> | |
exit(scanning_error); |
This file contains hidden or 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
html { | |
font-family: 'helvetica, sans-serif' | |
} | |
h1, h2{ | |
color: #1B4D3E; | |
} | |
h2{ | |
color: #2E8B57; | |
} |