Skip to content

Instantly share code, notes, and snippets.

import Data.Char (intToDigit)
import Network.URI
import Network.HTTP
--import Text.JSON
import Maybe
import Text.Regex.Posix
import Control.Monad
import Control.Parallel.Strategies
import Control.Parallel
--import System.IO.UTF8
public partial class Form1 : Form
{
static BaumNode root;
public Form1()
{
InitializeComponent();
}
private int getMaxHeight(BaumNode node)
{
@metaxy
metaxy / PGNBaumNode
Created November 22, 2010 11:34
PGN BaumNode
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PGN
{
class BaumNode
{
@metaxy
metaxy / b-tree.hs
Created October 31, 2010 21:02
This is a sample implementation of a b-tree.
module BTree (
BTree,
search,
insert,
delete,
emptyTree,
testTree,
insertALot,
insertALot2,
insertALot3,
@metaxy
metaxy / gist:648823
Created October 27, 2010 10:51
B-Baum
-- http://www.haskell.org/pipermail/haskell-cafe/2005-November/012009.html only def
data BTree = BTree [Int] [BTree] deriving (Show, Eq)
t = 2 -- t ist die minimale anzahl an kindknoten
if' :: Bool -> a -> a -> a
if' True x _ = x
if' False _ y = y
isLeaf (BTree x y) = length y == 0
class Baum
{
public Baum()
{
child0 = null;
child1 = null;
value = 0;
}
public Baum child0{set; get;}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Blatt<T> : Blattbaum
{
T val { get; set; }
{--polylist a@([q,p]:xs) = pl' a p []
where
p' ([q,p]:xs) e l
pl' [] _ l = l
| p == e = pl' xs (e-1) (l++[q])
| otherwise = pl' ([q,e]:xs) (e-1) (l++[0])--}
type Polynom = [(Int,Int)]
polyplus :: Polynom -> Polynom -> Polynom
--polyplus [] p = p
---polypuls p [] = p
@metaxy
metaxy / stapel
Created August 30, 2010 10:48
Ein Stapel in Haskell
module Stapel (
Stapel,
empty,
isEmpty,
push,
top,
pop
) where
data Stapel a = E | S a (Stapel a) deriving(Eq,Show)
empty = E
module Set (
Set,
empty,
insert,
delete,
--isEmpty,
--isElement,
--card,
--intersection,
--union,