M.3. program. Quicksort
quicksort([H|T]) ->
{Smaller_Ones,Larger_Ones} = split(H,T,{[],[]}),
lists:append( quicksort(Smaller_Ones),
[H | quicksort(Larger_Ones)]
);
quicksort([]) -> [].
split(Pivot, [H|T], {Acc_S, Acc_L}) ->
if Pivot > H -> New_Acc = { [H|Acc_S] , Acc_L };
true -> New_Acc = { Acc_S , [H|Acc_L] }
end,
split(Pivot,T,New_Acc);
split(_,[],Acc) -> Acc.
Implement the program in an own module or integrate it where you implemented basic programming problems. Create an interface function to this module whose first parameter is the programming problem to be run, the second is the set or scalar type variable with which the program should be run. Add error handling routines to the module and to its exported functions. At this phase you can use the previously implemented error handling function which, besides the error message, also shows which function call caused it. The error handler is worth extending with a clause which does not display errors but results of the particular functions formatted according to the type of the particular return value.
2.3. The source codes, and the output screens of the programs from the article
Hello world
The output screen of the program
Multiplication
The output screen of the program
Sum
The output screen of the program
Random numbers
The output screen of the program
Factorial
The output screen of the program
Pattern matching
The output screen of the program
Maximum value
The output screen of the program
Branches
The output screen of the program
Tuples and lists
The output screen of the program
List sum
The output screen of the program
Handling multiple return value
The output screen of the program
Handling two or more multiple return values
The output screen of the program
Handling records
The output screen of the program
Iterations
The output screen of the program
List sum 2
The output screen of the program
Maximum and average
The output screen of the program
2. factorial program
The output screen of the program
Pythagoras
The output screen of the program
Pythagoras 2
The output screen of the program
Permutations
The output screen of the program
Ordering list
The output screen of the program
Handling records 2
The output screen of the program
Surface
The output screen of the program
Temperature
The output screen of the program
Atomic datas
The output screen of the program
Guard expression
The output screen of the program
IO test
The output screen of the program
Using dictionary
The output screen of the program
Bibliográfia
Programozási nyelvek, Volume.: Programozási nyelvek, Funkcionális programozási nyelvek elemei 2006., Szerk.: Nyékyné GaizlerJuditHorváth, Zoltán pages 589-636. ISBN 9-639-30147-7
Funkcionális programozás témakörei a programtervező képzésben 2005., Szerk.: PethőAttilaHerdonMiklósHorváth, Zoltán Csörnyei, ZoltánLövei, LászlóZsók, Viktória
Funkcionális programozás nyelvi elemei Technical University of Kosice, Kassa, Slovakia, 2005., Horváth, Zoltán
Refactoring in Erlang, a Dynamic Functional Language Proc. of 1st Workshop on Refactoring Tools (WRT07)}, ECOOP 2007 , ISSN 1436-9915, 2007., Lövei, LászlóHorváth, ZoltánKozsik, TamásKirály, RolandVíg, AnikóNagy, TamásDigDannyCebullaMichael
Refactoring in Erlang, a Dynamic Functional Language Central European Functional Programming School, volume 5161/2008, Lecture Notes in Computer Science, pages 250-285, 2008, 2008., Lövei, LászlóHorváth, ZoltánKozsik, TamásKirály, RolandVíg, AnikóNagy, TamásTóth, MelindaKitlei, Róbert
Lambda-kalkulus Typotex, Budapest, 2007., Csörnyei, Zoltán
Típuselmélet (kézirat) 2008., Csörnyei, Zoltán
\LaTeX\ kézikönyv Panem Könyvkiadó, 2004., Wett, FerencMayer, GyulaSzabó, Péter
Functional Programming in Clean 2010., http://wiki.clean.cs.ru.nl/Functional_Programming_in_Clean
F# at Microsoft Research 2010., http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/
The Haskell language 2010., http://www.haskell.org/onlinereport/
Lisp Massachhussetc Institute of Technology - ISBN: 0-201-08329-9 Addison Wesley 8329 USA , 1981., Henry Winston, PatricKlaus, BertoldHorn, Paul
Bevezetés a Linux használatába ISBN: 9789639425002, 2005., Sikos, László
Szoftverfejlesztés Java EE platformon Szak Kiadó ISBN: 9789639131972 , 2007., Imre, Gábor
GNU Emacs 2010., http://www.gnu.org/manual/manual.html
Mnesia Database Management System 2011., http://www.erlang.org
The Eclipse Foundation open source community 2011., http://www.eclipse.org/
Created by XMLmind XSL-FO Converter.
Share with your friends: |