LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-11-2004, 12:37 PM   #1
mcshen
LQ Newbie
 
Registered: Dec 2003
Distribution: womandrake
Posts: 28

Rep: Reputation: 15
huffman algorithm


I am just wondering how one would find the priority(by the standard below) if he/she is given the frequency..

would priority = 1/frequency work?

higher frequency
10,9,8,7,6,5,4,3,2,1

higher priority
0,1,2,3,4,5,6,7,8,9


basically, higher Frequency(the number is bigger) -> Higer priority(number is smaller), so a priority of 0 will mean frequency of 10
 
Old 03-11-2004, 12:45 PM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I'm not sure what you mean... priority and frequency of what?

If you're saying that:

frequency(10) = priority(0)
frequency(9) = priority(1)
...

then I guess subtract either one from 10 and you have the other.
 
Old 03-12-2004, 01:50 PM   #3
mcshen
LQ Newbie
 
Registered: Dec 2003
Distribution: womandrake
Posts: 28

Original Poster
Rep: Reputation: 15
yes. that's what i mean. I will try that. thanks
 
Old 03-12-2004, 02:00 PM   #4
Mohsen
Member
 
Registered: Feb 2003
Location: Iran
Distribution: Solaris 10
Posts: 201

Rep: Reputation: 30
Instead of doing that it's better trying to make the Huffman tree. It's quite easy. And do not need to be careful about priorities and frequencies.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best cryptographic algorithm? Linux.tar.gz Linux - Security 19 05-02-2006 08:54 PM
about watershed algorithm caicaicherry Programming 4 09-22-2005 03:36 AM
School project : reproducing huffman networking compression gusx Linux - Networking 1 09-19-2005 09:25 PM
Which sorting algorithm? nodger Programming 6 01-28-2005 06:13 PM
Airsnort Algorithm inthefuture Linux - Security 1 08-26-2004 10:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration