Abstract | Algoritmi, matematički načini rješavanja informatičkih problema pojavljuju se u antičko vrijeme, a u 9. stoljeću dobivaju naziv po prezimenu perzijskog matematičara al-Khwārizmī koje latinizirano zvuči Algoritmija. Primjena algoritama počela je u matematici da bi se u današnje vrijeme najviše koristila u informatici ali i u disciplini kreiranja i slanja šifriranih poruka, kriptografiji. Moj rad bavi se teorijskom prirodom algoritama a pitanju funkcije algoritama i načina njihovog funkcioniranja pristupam komparativno i analitički. Pojašnjene su funkcije algoritama, a kroz praksu su na primjerima prikazani načini funkcioniranja algoritama u određenim programskim jezicima. Usporedbom algoritama po parametrima poput efikasnosti, brzine te vremenske kompleksnosti povezat ću teoriju algoritama s njihovim značenjem za prosječnog čovjeka u svakodnevnom ţivotu. Prikazom šest algoritama pokazat ću njihove osnovne značajke. Primjerice pokazat ću kako je Heap sort, prvi algoritam u ovom radu, vrlo brz i efikasan a temelj mu je binarno stablo. Quick sort je također brz i efikasan, jako koristan, a metoda njegovog rada je „divide and conquer“. Insertion sort je koristan algoritam u određenim situacijama, kod malih nizova, stabilan je, međutim nije baš efikasan. Merge sort je jako brz, koristi „divide and conquer metodu“ jednako kao quick sort, međutim iako jednostavan i brz, u manjim nizovima je spor. Shell sort „in place“ metoda, je varijacija na Insertion sort, ali je jednostavniji i optimiziran. Bubble sort jako jednostavan, ograničene je uporabe samo na edukacije o algoritmima, te spor je i dugačak. Ovaj rad donosi usporedbu navedenih šest algoritama iz koje je jasno vidljivo da svaki od algoritama najbolje funkcionira u određenim situacijama te ni za jednog ne možemo reći da je najbolji ili najlošiji nego su podjednako dobri ili manje dobri ovisno o zahtjevima situacije u kojima se koriste |
Abstract (english) | Algorithms, mathematical ways of solving computer problems appear in ancient times and in the 9th century were named after the surname of the Persian mathematician al-Khwārizmī, which in Latin sounds like Algorithm. The application of algorithms began in mathematics, and nowadays it is mostly used in informatics, but also in the discipline of creating and sending encrypted messages, cryptography. My paper deals with the theoretical nature of algorithms and I approach the question of the function of algorithms and the way they work in comparative and analytical manner. The functions of algorithms are explained, and through practice, the ways of functioning of algorithms in certain programming languages are shown thru examples. By comparing algorithms by parameters such as efficiency, speed and time complexity, I will connect the theory of algorithms with their significance for the average person in everyday life. By showing six algorithms I will show their basic features. For example, I will show how the Heap sort, the first algorithm in this paper, is very fast and efficient and is based on a binary tree. Quick sort is also fast and efficient, very useful, and the method of his work is "divide and conquer". Insertion sort is a useful algorithm in certain situations, in small arrays. It is stable, but it is not very efficient. Merge sort is very fast, it uses the "divide and conquer method" as well as the quick sort, but although simple and fast, it is slow in smaller series. The shell sort "in place" method is a variation on the Insertion sort, but is simpler and optimized. Bubble sort is very simple, its limitation is in its predominant use in education about algorithms. It is slow and long. This paper brings a comparison of these six algorithms from which it is clear that each of the algorithms works best in certain situations and none can be said to be the best or worst but are equally good or less good depending on the requirements of the situation in which they are used. |