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
| package forcomp | |
| import common._ | |
| object Anagrams { | |
| /** A word is simply a `String`. */ | |
| type Word = String | |
| /** A sentence is a `List` of words. */ |
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
| package patmat | |
| import common._ | |
| /** | |
| * Assignment 4: Huffman coding | |
| * | |
| */ | |
| object Huffman { |
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
| package objsets | |
| import common._ | |
| import TweetReader._ | |
| import java.lang.String._ | |
| /** | |
| * A class to represent tweets. | |
| */ | |
| class Tweet(val user: String, val text: String, val retweets: Int) { |
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
| package quickcheck | |
| import common._ | |
| import org.scalacheck._ | |
| import Arbitrary._ | |
| import Gen._ | |
| import Prop._ | |
| abstract class QuickCheckHeap extends Properties("Heap") with IntHeap { |
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
| package funsets | |
| import org.scalatest.FunSuite | |
| import org.junit.runner.RunWith | |
| import org.scalatest.junit.JUnitRunner | |
| /** | |
| * This class is a test suite for the methods in object FunSets. To run | |
| * the test suite, you can either: |
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
| package recfun | |
| import common._ | |
| object Main { | |
| def main(args: Array[String]) { | |
| println("Pascal's Triangle") | |
| for (row <- 0 to 10) { | |
| for (col <- 0 to row) | |
| print(pascal(col, row) + " ") | |
| println() |