You are urged to work in groups of two. Each group should submit ONE program per group. Be sure to include name and matric number of each person in your group in the README file that belongs with the submission. Do not wait until the last minute to start this assignment.
"Do not wait until the last minute to start this assignment."
ahaha..but what we normally do is..
"Do wait until the last minute to start this assignment."
oh, itu la student, selagi kiter tak mau berak, selagi tu kiter tak kan korek tanah kan..huhu
--------------------------------------------------------------
The Huffman Compression Algorithm
The Huffman Compression algorithm is an algorithm used to compress files. It does this by assigning smaller codes to frequently used characters and longer codes for characters that are less frequently used.
The algorithm has four steps.
1. To compress a file, count how many times every character occurs in a file. These counts are used to build weighted nodes that will be leaves in the Huffman tree.
2. From these counts build the Huffman tree. First create one node per character, weighted with the number of times the character occurs, and insert each node into a priority queue.
3. Create a table or map of characters (8-bit chunks) to codings. All characters/encoding bit pairs may be stored in some kind of table or map to facilitate easy retrieval later.
4. Finally, read the input file a second time. For each character/8-bit chunk read, write the encoding of the character (obtained from the map of encodings) to the compressed file.
--------------------------------------------------------------
yea~ itula dia kerja nya, concept senang je paham.. kalu setakat buat atas whiteboard terangkan kt orang xde masalah tp this thing kena buat dalam coding.. oh tergaru pala aku~
malam tadi pahamkan coding dari YQ.. agak susah nk paham coding orang lain, ahaha.. last2 aku decide tuk gune care aku tapi aku amik coding YQ tuk interface, sbb interface dia power.. so bagus gak ade grupmate, combine idea maa~
pastu tengah tension2 pahamkan coding java ni.. ade pulak orang mintak aku tolong dia nye projek dalam php.. mau tak pusing pala aku, kejap java kejap php.. aku terlalu giler tension malam tadi, last2 aku lepas geram kt paez.. walaupun paez pun tengah tension tp dah dia jek online, takkan aku nk mengamuk kt orang yg buat aku mengamuk kan.. ngahaha.. [maafkan aku ye paezz gumuk~]
tension~ geram~ marah~ hot~ nk lempang orang~~!! itu la yg aku rase biler orang tu mendesak suh aku tengokkan masalah coding dia.. aku sangat geram tahap babis sbb orang tak memahami aku.. come on la~ aku tengah buat kerja aku, lain la kalu aku tengah tergolek atas katil ke menari sehati berdansa ke.. aku baik, baik la jugak tapi baik aku tu ade tahap gak..
aku penat, penat tolong orang.. bak kate abah, buat baik berpada.. make sure diri sendiri tertolong b4 nk tolong orang.. yup kate abah mmg benar.. tapi aku terlalu nk jage hati orang sampai kadang2 at the end aku yg makan hati sorg2..
yela kan, manusia ni cepat luper budi.. biler kiter tolong dorg, dorg sayang sayang.. biler kiter tak dapat nk tolong, dorg benci mengata kiter , dimana dorg luper yg kiter penah tolong dorg..
~~~ [erk~ adakah aku emo?? ayat bermadah kate.. mmg emo gamatnye] ~~~
dah~~ luperkan manusia yg luper daratan, sambung citer projek aku..
akhirnye aku siap gak projek ni~ keesokan harinye, lepas kelas Network, kitorg nk bincang projek.. dan seperti biase, YQ bawak laptop.. yang kelakar tu, mase aku ngn YQ duduk depan laptop tu, classmate lain sumer tgk ape yg kitorg wat..
"uit~ ape korg sumer tgk?? kitorg wat pojek huffman lor~"
"uit~ ape korg sumer tgk?? kitorg wat pojek huffman lor~"
agak2 lepas dorg sumer dah kuar, barulah kitorg bincang.. rupenye pemahaman YQ dan aku lain tentang huffman ni.. agak berdebat gak kitorg ttg sape yg betul..
opinion aku: each file akan ade it owns huffman table code, so b4 the file can be decode, it must do the encoded to get it huffman table code..
tapi..
opinion YQ: any file will using the same huffman table code.. which makes any encoded file will be decode using the same huffman table..
dan akhirnya~
YQ: are you sure it that way?
me: i donno but thats what i understand about huffman.. [ tegasss~~!! ]
YQ: erm~ erk~ i think your understanding is the true one..
yeah~ menang~
pastu kitorg edit ler coding tu supaya jadik lebih mantap, power dan jitu.. [ahaha poyo]
selepas 2 jam berada dalam bilik aircon, sejuk giler...
akhirnye siapp projek kami dan kitorg terus submit dan2 tu jugak~
ini lah interface nye..
yeah~ happy sangat sebab dah siap, dan thanks to my groupmate.. seronok woo biler satu grup dgn YQ.. sbb ape yg aku paham, dia pun paham same.. so senang tuk kitorg kongsi idea.. xde la sorg blur, sorg je wat keja kan.. huhu.. pastu tetibe terpk pasal projek OOP, aku pun dengan slumber tanye YQ ade grup dah ke..
warghh~~ dia xtau pun menda tu projek dan comfirm la dia xde grup kan..
yeahh~~ aku dh ade grupmate tuk OOP Projek~ senang hati~ huhu
**note: sila jangan ada yg terasa bagi post kali ini..tenkiu~
No comments:
Post a Comment