473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

data structure


Build an efficient Huffman tree using the algorithm we discussed in
class from the following table

Frequency Table
character frequency Huffman code

B 2067 _ _ _ _ _ _ _
F 3397 _ _ _ _ _ _ _
J 2155 _ _ _ _ _ _ _
P 1581 _ _ _ _ _ _ _
V 1032 _ _ _ _ _ _ _
Z 497 _ _ _ _ _ _ _

A) Create a Huffman tree to determine the binary codes for each
character.

B) Fill the codes into the table above.

Feb 16 '07 #1
4 2598
On 16 Feb, 09:50, "Rana Naveed" <rananaveedkha...@gmail.comwrote:
Build an efficient Huffman tree using the algorithm we discussed in
class from the following table
I'm afraid I wasn't in that class so I don't know what algorithm we
discussed.

<snip homework assignment with no attempt at a solution>

Read this
http://www.parashift.com/c++-faq-lit...t.html#faq-5.2

Now, there are plenty of people here who are willing to help you with
your homework (helping you is not the same as doing it for you). Here
is how to help them help you.
http://www.parashift.com/c++-faq-lit...t.html#faq-5.8

Gavin Deane

Feb 16 '07 #2
On 16 feb, 10:50, "Rana Naveed" <rananaveedkha...@gmail.comwrote:
Build an efficient Huffman tree using the algorithm we discussed in
class from the following table

Frequency Table
character frequency Huffman code

B 2067 _ _ _ _ _ _ _
F 3397 _ _ _ _ _ _ _
J 2155 _ _ _ _ _ _ _
P 1581 _ _ _ _ _ _ _
V 1032 _ _ _ _ _ _ _
Z 497 _ _ _ _ _ _ _

A) Create a Huffman tree to determine the binary codes for each
character.

B) Fill the codes into the table above.
Build an efficient program to calculate the meaning of life, the
universe and everything like discussed in the famous novell.

A) The answer must be different from 41.
B) Calculate it in less then 7,5 million years.

just couldn't resist.. ;-p

Feb 16 '07 #3
Gavin Deane <de*********@hotmail.comwrote:
On 16 Feb, 09:50, "Rana Naveed" <rananaveedkha...@gmail.comwrote:
>Build an efficient Huffman tree using the algorithm we discussed in
class from the following table

I'm afraid I wasn't in that class so I don't know what algorithm we
discussed.
Also, I didn't even see a C++ question in the OP. Maybe the OP should
try something like sci.math or comp.programming.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Feb 16 '07 #4
jamx wrote:
On 16 feb, 10:50, "Rana Naveed" <rananaveedkha...@gmail.comwrote:
>Build an efficient Huffman tree using the algorithm we discussed in
class from the following table

Frequency Table
character frequency Huffman code

B 2067 _ _ _ _ _ _ _
F 3397 _ _ _ _ _ _ _
J 2155 _ _ _ _ _ _ _
P 1581 _ _ _ _ _ _ _
V 1032 _ _ _ _ _ _ _
Z 497 _ _ _ _ _ _ _

A) Create a Huffman tree to determine the binary codes for each
character.

B) Fill the codes into the table above.

Build an efficient program to calculate the meaning of life, the
universe and everything like discussed in the famous novell.

A) The answer must be different from 41.
B) Calculate it in less then 7,5 million years.

just couldn't resist.. ;-p
#include <iostream>

int multiplySixByNine() {
return 42;
}

int main() {
int atltuae = multiplySixByNine();
std::cout << atltuae << std::endl;
}

Note: Actual run time is system dependent, but on one system I got:
real 0m0.006s
user 0m0.002s
sys 0m0.002s
Feb 16 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dmb000006 | last post by:
Hello, I have a database style data structure, each record has several fields. I would like to create a nested data structure that would let me 'query' the data on the value of certain...
5
by: Jeff | last post by:
I've created a beast! Here is my data structure: $VAR1 = 'bunkers'; $VAR2 = { 'items' => , \ ] }; $VAR3 = 'simpsons'; $VAR4 = {
3
by: narasimha | last post by:
Hello, I have a data record with two fields...<value, date>. I have more than a million of these records. As I add more records into this set, I want a data structure that would be efficient...
2
by: yee young han | last post by:
I need a fast data structure and algorithm like below condition. (1) this data structure contain only 10,000 data entry. (2) data structure's one entry is like below typedef struct _DataEntry_...
4
by: Dan | last post by:
I'm trying to creat a data structure, that can be either a integer, double, string, or linked list. So I created the following, but don't know if it is the data structure itself causing problems,...
5
by: Alfonso Morra | last post by:
Hi, I am writing a messaging library which will allow me to send a generic message structure with custom "payloads". In many cases, a message must store a non-linear data structure (i.e....
6
by: James | last post by:
I am using vb.net and need to keep in memory a large data structure, so I am looking for the best option. And after several test I am pretty confused. So I will be grateful if anyone can help me. ...
5
by: Lloyd Dupont | last post by:
I'm attempting to write a fairly complex data structure. One part of the complexity is that all 8 data operations it supports delegate some code to virtual method. This is by design because I...
3
by: Christopher | last post by:
Is it possible to dynamically create a data structure? Not that it matters, but just for understanding, I am working with video shaders, these shaders use thier own language (HLSL) which you...
0
by: DopeyinIdaho | last post by:
We have a lot of legacy code written in C/C++ that maintains data in shared memory structures. In the C/C++ implementations, for a lot of functions, we get a pointer to the shared memory address then...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.