doesn't provide constant access time array? One idea is to to turn the
transform vector T into a function, just like what we've done in KMP
implementation in FP way. Does such solution exist?
Regards.
--
Larry, LIU Xinyu
https://github.com/liuxinyu95/AlgoXY
On Friday, June 24, 2011 6:50:46 AM
Hi,
I read a previous thread about BWT implementation in Haskell:
http://www.mail-archive.com/haskell-cafe@haskell.org/msg25609.html
and
http://sambangu.blogspot.com/2007/01/burrows-wheeler-transform-in-haskell
They are all in a `brute-force' way, that is implement based on
Burrows-Wheeler's def
Hi,
I browsed the current AVL tree implementation in Hackage
http://hackage.haskell.org/packages/archive/AvlTree/4.2/doc/html/src/Data-Tree-AVL-Push.html
AVL tree denote the different of height from right sub-tree to left
sub-tree as delta, to keep the
balance, abs(delta)<=1 is kept as invariant.
test (prop_foo::[Int]->Property)
Cheers.
--
Larry.
On Apr 22, 5:56 am, Nick Smallbone wrote:
> "larry.liuxinyu" writes:
> > Somebody told me that:
> > Eduard Sergeev • BTW, more recent QuickCheck (from Haskell Platform
> > 2011.2.0.X - contains QuickCheck-2.4.0
** Failed! Falsifiable (after 3 tests and 2 shrinks):
[0,1]
False
--
Larry
On Apr 20, 11:36 pm, Nick Smallbone wrote:
> "larry.liuxinyu" writes:
> > prop_foo :: (Ord a) => [a] -> Property
> > prop_foo xs = not (null xs) ==> maximum xs == minimum xs
>
> >
Hi,
I found there is similar question as:
http://groups.google.com/group/haskell-cafe/browse_thread/thread/7439262e9ac80dd2/91ca18e11ff00649?lnk=gst&q=QuickCheck+Ord+a#91ca18e11ff00649
I am still think it's very strange. For example:
prop_foo :: (Ord a) => [a] -> Property
prop_foo xs = not (null
= if matched succs then (succs, ns++[n])
else (succs, ns)
| otherwise = tr (fails, ns) (x, n)
In the program, tr is the transfer function applied to the state tree.
And build function is used to build the automaton.
Best regards.
--
LIU
On Mar 3, 5:25 pm, "larry.liuxinyu" wrote
Hi,
I read about some KMP implementation in Haskell including:
[1] Richard Bird. ``Pearls of Functional algorithm design''
[2] http://twan.home.fmf.nl/blog/haskell/Knuth-Morris-Pratt-in-Haskell.details
[3] http://www.haskell.org/haskellwiki/Runtime_compilation
[4] LazyString version
[1] buil
Hi,
I wrote a Haskell program to parse K-ary forest and convert it to dot script
(Graphviz).
Here is the literate program.
-- First is some stuff imported:
module Main where
import System.Environment (getArgs)
import Text.ParserCombinators.Parsec
import Control.Monad (mapM_)
import Data.List (
Hi,
Sorry for there is a bug in my previous post.
The example consolidate function for number should be like this:
consolidate xs = foldl meld [] xs where
meld [] x = [x]
meld (x':xs) x | x == x' = meld xs (x+x')
| x < x' = x:x':xs
| otherwise = x':
Hi,
In CLRS, there are algorithms about DECREASE-KEY and DELETE-NODE.
However, in the Functional approach, I didn't find corresponding solution.
One approach may just mark the node as `deleted' and when pops the top
element from the heap, we repeat it until find a unmarked node.
--
LIU
https://s
Hi,
I checked the current Fibonacci Queue in Hackage DB:
http://hackage.haskell.org/packages/archive/pqueue-mtl/1.0.7/doc/html/src/Data-Queue-FibQueue.html#FQueue
And a history email for Okasaki in 1995:
http://darcs.haskell.org/nofib/gc/fibheaps/orig
The hardest part is how to consolidate all u
Hi,
I just tried a smoke test case, seems the tree is balanced enough:
import System.Random
lookup :: (Ord a) => STree a -> a -> STree a
lookup E _ = E
lookup t@(Node l x r) y
| x == y= t
| x > y = splay (Node (lookup l y) x r) y
| otherwise = splay (Node l x (lookup r y)) y
13 matches
Mail list logo