This file contains 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
pub mod data { | |
pub struct Tree<A> { | |
value: A, | |
children: Vec<Tree<A>>, | |
} | |
impl<A> Tree<A> { | |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
// Construction | |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
This file contains 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
-- IsomorphieVonBaeumen.hs | |
-- Eine Haskell-Implementierung der Einsendeaufgabe 01613 4.4 | |
import Data.Maybe (isJust, fromJust) | |
-- ------------------------------------------------------------------------ | |
-- Die Datenstruktur für den Binärbaum | |
-- ------------------------------------------------------------------------ | |
data Tree a = Node { value :: a, left :: Tree a, right :: Tree a } |
This file contains 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
ASCII-Art der Eingabedaten/Baumstruktur | |
1 | |
/ \ | |
/ \ | |
2 9 | |
/ \ | |
4 5 |
This file contains 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
program Aufgabe(input, output); | |
type | |
tRefIndexListe = ^tIndexListe; | |
tIndexListe = record | |
index:integer; | |
wert:String; | |
next:tRefIndexListe | |
end; |
This file contains 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
A := [2,Hund][3,Aal][4,Katze][7,Maus] | |
x := [3,Tiger] | |
add(A, x) := [2,Hund][3,Tiger][4,Aal][5,Katze][7,Maus] |
This file contains 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
program Maximum (input, output); | |
var | |
Eingabe : integer; | |
Zahl : integer; | |
begin | |
{ initialization } | |
Eingabe := 0; | |
Zahl := 0; |
This file contains 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
#if !defined(ELEMENT_HPP) | |
#define ELEMENT_HPP | |
#include <memory> | |
#include <iostream> | |
template<class T> | |
struct Element | |
{ | |
using ElementPtr = std::unique_ptr<Element<T>>; |
This file contains 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
#!/usr/bin/env python3 | |
# ----------------------------------------------------------------------------- | |
# Copyright (c) 2015, Heiko Möllerke | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains 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
#!/usr/bin/env python3 | |
# ----------------------------------------------------------------------------- | |
# Copyright (c) 2015, Heiko Möllerke | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains 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
#!/usr/bin/env python3 | |
# ----------------------------------------------------------------------------- | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014, Heiko Möllerke | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |