1. Huffman coding application
- Author
-
Pleš, Manuel and Baumgartner, Alfonzo
- Subjects
Huffman code ,TEHNIČKE ZNANOSTI. Računarstvo. Informacijski sustavi ,iOS ,Huffmanovo stablo ,Huffman algorithm ,Huffmanov algoritam ,Huffman tree ,TECHNICAL SCIENCES. Computing. Information Systems ,Huffmanov kod ,Swift - Abstract
U ovom završnom radu kreirana je iOS mobilna aplikacija za Huffmanovo kodiranje. Objašnjen je Huffmanov algoritam i alati koji se koriste za izradu aplikacije. Problem s kojim se susreće je pretvaranje koraka Huffmanovog algoritma u njihov ekvivalent u kodu i rješenje koje se nudi dano je u dva dijela. Prvi dio implementacije zadužen je za izradu Huffmanovog stabla koje u programu izgleda drugačije od običnog stabla, ali ima istu funkciju. Drugi dio zadužen je za prolazak i čitanje stabla i to je postignuto rekurzivnom funkcijom. Veliku ulogu u ostvarenju rješenja ovog problema ima mogućnost programskog jezika Swift da koristi tip podatka „Any“ koji u potpunosti mijenja ulogu pokazivača. Cijeli proces sakriven je iza jednostavnog korisničkog sučelja koje omogućava korisniku upisivanje znakova koje želi kodirati i njihovo kodiranje pritiskom samo jednog dugmeta. In this bachelor's thesis an iOS mobile application was created. The Huffman algorithm and the tools used to create the application were explained. The problem encountered is transforming the steps of the Huffman algorithm into their equivalent in code and the answer offered is given in two parts. The first part of the implementation is in charge of creating the Huffman tree which looks different in the program than the usual tree but has the same functionality. The second part of the implementation is in charge of going through and reading from the tree and that was accomplished with a recursive function. A great part in achieving the goal of solving this problem was the possibility of the programming language Swift to use the data type “Any” which completely replaced the role of pointers. The whole process was hidden behind a simple user interface which allows the user to enter the characters he wants to encode and then encodes them with the press of a button.
- Published
- 2020