This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
cs330_f2016:labx [2016/06/15 20:52] dcostello created |
cs330_f2016:labx [2021/06/30 23:42] (current) |
||
---|---|---|---|
Line 30: | Line 30: | ||
-- Examples | -- Examples | ||
- | (build_infinite_list *x) = [2,4,6,8,...] | + | (build_infinite_list (*2)) = [2,4,6,8,...] |
</code> | </code> | ||
Lazily constructs an infinite list such that list!!i returns (f i). | Lazily constructs an infinite list such that list!!i returns (f i). | ||
Line 56: | Line 56: | ||
</code> | </code> | ||
- | ==fastIsPrime== | + | ==isPrimeFast== |
<code haskell> | <code haskell> | ||
-- Type Signature | -- Type Signature | ||
- | fastIsPrime :: Integer -> bool | + | isPrimeFast :: Integer -> bool |
</code> | </code> | ||
- | Takes an integer n and returns true if n is prime. **Only test prime factors from fastPrimes.** | + | Takes an integer n and returns true if n is prime. **Only test prime factors from primesFast.** |
- | ==fastPrimes== | + | ==primesFast== |
<code haskell> | <code haskell> | ||
-- Type Signature | -- Type Signature | ||
- | fastPrimes :: [Integer] | + | primesFast :: [Integer] |
</code> | </code> | ||
- | Create an infinite list of all primes and name it fastPrimes. **Must be constructed with fastIsPrime.** | + | Create an infinite list of all primes and name it primesFast. **Must be constructed with isPrimeFast.** |
===Part 3: Longest Common Sub-sequence=== | ===Part 3: Longest Common Sub-sequence=== | ||
Line 88: | Line 88: | ||
Warning: Many people erroneously implement the longest common substring. The longest common substring of Artist and Artsy is Art. The longest common subsequence of Artist and Artsy is Arts. You are implementing longest common subsequence. | Warning: Many people erroneously implement the longest common substring. The longest common substring of Artist and Artsy is Art. The longest common subsequence of Artist and Artsy is Arts. You are implementing longest common subsequence. | ||
+ | |||
+ | ===Hints:=== |