SlideShare a Scribd company logo
1 of 7
Download to read offline
Need help with this paper
This assignment consists of writing research paper surveying a popular algorithm. Your paper
must conform to
the American Psychological Association (APA) writing style.
There are many good online resources for the APA style.Your paper must use reputable
scholarly references. Most Web sources such as blog, forums, and personal website are not
considered reputable(do not cite or use any Wiki or Answer.com type websites). Your paper
should use 11pt or 12pt font size for the main text. Other text such as figure and table labels and
captions, if applicable, should be no smaller then 10pt. A typical research paper for this
assignment is about 7-10 double spaced pages (not including the cover page or reference page).
Topics:
Choose one of the following algorithms areas to write about. Potential algorithm topics related
to the algorithm area are included in parenthesis as examples.
1.Hashing Algorithms (e.g.SHA-3;Message Digest-5;Cryptography algorithms such as
Advanced Encryption Standard, Blowfish,Elliptic curve cryptography;Digital signature
algorithms; Bitcoin Mining)
2.Compression Algorithms (e.g. LZO, Data differencing, Huffman Coding)
3.String Matching (e.g Google’s PageRank algorithm , DNA sequence algorithms, Spell
checking algorithms)
4.Memory Management (e.g. Garbage Collection, Buddy Methods, Paging
algorithms,Sequential-Fit Methods)
Solution
public final category Huffman non-public Huffman() ;
non-public static category HuffmanNode
}
non-public static category HuffManComparator implements Comparator<HuffmanNode> come
back node1.frequency - node2.frequency;
}
}
/**
* Compresses the string victimisation huffman formula.
* The huffman tree and also the huffman code area unit serialized to disk
*
* @param sentence The sentence to be serialized
* @throws FileNotFoundException If file isn't found
* @throws IOException If IO exception happens.
*/
public static void compress(String sentence) throws FileNotFoundException, IOException ought
to atleast have one character.");
}
final Map<Character, Integer> charFreq = getCharFrequency(sentence);
final HuffmanNode root = buildTree(charFreq);
final Map<Character, String> charCode = generateCodes(charFreq.keySet(), root);
final String encodedMessage = encodeMessage(charCode, sentence);
serializeTree(root);
serializeMessage(encodedMessage);
}
non-public static Map<Character, Integer> getCharFrequency(String sentence) else
}
come map;
}
/**
* Map<Character, Integer> map
* Some implementation of that treeSet is passed as parameter.
* @param map
*/
non-public static HuffmanNode buildTree(Map<Character, Integer> map) whereas
(nodeQueue.size() > 1)
// take away it to forestall object leak.
come nodeQueue.remove();
}
non-public static Queue<HuffmanNode> createNodeQueue(Map<Character, Integer> map)
return pq;
}
non-public static Map<Character, String> generateCodes(Set<Character> chars, HuffmanNode
node) {
final Map<Character, String> map = new HashMap<Character, String>();
doGenerateCode(node, map, "");
come map;
}
non-public static void doGenerateCode(HuffmanNode node, Map<Character, String> map,
String s)
doGenerateCode(node.left, map, s + '0');
doGenerateCode(node.right, map, s + '1' );
}
non-public static String encodeMessage(Map<Character, String> charCode, String sentence)
come stringBuilder.toString();
}
non-public static void serializeTree(HuffmanNode node) throws FileNotFoundException,
IOException attempt (ObjectOutputStream oosTree = new ObjectOutputStream(new
FileOutputStream("/Users/ap/Desktop/tree"))) strive (ObjectOutputStream oosChar = new
ObjectOutputStream(new FileOutputStream("/Users/ap/Desktop/char"))) soft to mark finish of
bit set relevant for deserialization.
oosTree.writeObject(bitSet);
}
}
}
non-public static category IntObject
/*
* Algo:
* 1. Access the node
* 2. Register the worth in bit set.
*
*
* here true and false dont correspond to left branch and right branch.
* there,
* - true means that "a branch originates from leaf"
* - false mens "a branch originates from non-left".
*
* additionally since branches originate from some node, the foundation node should be provided
as supply
* or place to begin of initial branches.
*
* Diagram and the way associate degree bit set would look as a result.
* (source node)
* / 
* true true
* / 
* (leaf node) (leaf node)
* | |
* false false
* | |
*
* thus currently somewhat set appears like [false, true, false, true]
*
*/
non-public static void preOrder(HuffmanNode node, ObjectOutputStream oosChar, BitSet
bitSet, IntObject intObject) throws IOException
bitSet.set(intObject.bitPosition++, true); // register branch in bitset
preOrder(node.left, oosChar, bitSet, intObject); // take the branch.
bitSet.set(intObject.bitPosition++, true); // register branch in bitset
preOrder(node.right, oosChar, bitSet, intObject); // take the branch.
}
non-public static void serializeMessage(String message) throws IOException attempt
(ObjectOutputStream oos = new ObjectOutputStream(new
FileOutputStream("/Users/ap/Desktop/encodedMessage")))
}
non-public static BitSet getBitSet(String message) else
}
bitSet.set(i, true); // dummy bit set to grasp the length
come bitSet;
}
/**
* Retrieves back the initial string.
*
*
* @return the initial uncompressed string
* @throws FileNotFoundException If the file isn't found
* @throws ClassNotFoundException If category isn't found
* @throws IOException If IOException happens
*/
public static String expand() throws FileNotFoundException, ClassNotFoundException,
IOException {
final HuffmanNode root = deserializeTree();
come decodeMessage(root);
}
non-public static HuffmanNode deserializeTree() throws FileNotFoundException, IOException,
ClassNotFoundException strive (ObjectInputStream oisBranch = new ObjectInputStream(new
FileInputStream("/Users/ap/Desktop/tree"))) strive (ObjectInputStream oisChar = new
ObjectInputStream(new FileInputStream("/Users/ap/Desktop/char")))
agencyBranch.readObject();
come preOrder(bitSet, oisChar, new IntObject());
}
}
}
/*
* Construct a tree from:
* input [false, true, false, true, (dummy faithful mark the top of bit set)]
* The input is built from preorder traversal
*
* Algo:
* one produce the node.
* 2. scan what's registered in bitset, and judge if created node is meant to be a leaf or non-leaf
*
*/
non-public static HuffmanNode preOrder(BitSet bitSet, ObjectInputStream oisChar, IntObject
o) throws IOException crucial if created node is that the leaf or non-leaf.
if (!bitSet.get(o.bitPosition)) succeeding position to subsequent stack frame by doing
computation before preOrder is named.
node.ch = oisChar.readChar();
come node;
}
o.bitPosition = o.bitPosition + 1; // feed subsequent position to subsequent stack frame by doing
computation before preOrder is named.
node.left = preOrder(bitSet, oisChar, o);
o.bitPosition = o.bitPosition + 1; // feed subsequent position to subsequent stack frame by doing
computation before preOrder is named.
node.right = preOrder(bitSet, oisChar, o);
come node;
}
non-public static String decodeMessage(HuffmanNode node) throws FileNotFoundException,
IOException, ClassNotFoundException strive (ObjectInputStream Office of Intelligence Support
= new ObjectInputStream(new
FileInputStream("/Users/ameya.patil/Desktop/encodedMessage"))) worker = node;
// since huffman code generates full binary tree, temp.right is definitely null if temporary
worker.left is null.
whereas (temp.left != null) {
if (!bitSet.get(i)) {
temporary worker = temporary worker.left;
} else {
temporary worker = temporary worker.right;
}
i = i + 1;
}
stringBuilder.append(temp.ch);
}
come stringBuilder.toString();
}
}
public static void main(String[] args) throws FileNotFoundException, IOException,
ClassNotFoundException range of characters
Huffman.compress("some");
Assert.assertEquals("some", Huffman.expand());
// odd range of characters
Huffman.compress("someday");
Assert.assertEquals("someday", Huffman.expand());
// continuance even range of characters + area + non-ascii
Huffman.compress("some some#");
Assert.assertEquals("some some#", Huffman.expand());
// odd range of characters + area + non-ascii
Huffman.compress("someday someday&");
Assert.assertEquals("someday someday&", Huffman.expand());
}
}

More Related Content

Similar to Need help with this paperThis assignment consists of writing resea.pdf

Serializing EMF models with Xtext
Serializing EMF models with XtextSerializing EMF models with Xtext
Serializing EMF models with Xtextmeysholdt
 
META-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docx
META-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docxMETA-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docx
META-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docxhoundsomeminda
 
Please read the comment ins codeExpressionTree.java-------------.pdf
Please read the comment ins codeExpressionTree.java-------------.pdfPlease read the comment ins codeExpressionTree.java-------------.pdf
Please read the comment ins codeExpressionTree.java-------------.pdfshanki7
 
5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системеDEVTYPE
 
write a java program related to Huffman coding.SolutionThe Jav.pdf
write a java program related to Huffman coding.SolutionThe Jav.pdfwrite a java program related to Huffman coding.SolutionThe Jav.pdf
write a java program related to Huffman coding.SolutionThe Jav.pdfjaronkyleigh59760
 
Write a program that takes any input text and produces both a frequen.pdf
Write a program that takes any input text and produces both a frequen.pdfWrite a program that takes any input text and produces both a frequen.pdf
Write a program that takes any input text and produces both a frequen.pdfarenamobiles123
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineMatt Provost
 
Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossumoscon2007
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual Vivek Kumar Sinha
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESMIgalia
 
CountryData.cppEDIT THIS ONE#include fstream #include str.pdf
CountryData.cppEDIT THIS ONE#include fstream #include str.pdfCountryData.cppEDIT THIS ONE#include fstream #include str.pdf
CountryData.cppEDIT THIS ONE#include fstream #include str.pdfAggarwalelectronic18
 
Unit 6
Unit 6Unit 6
Unit 6siddr
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid themSteven Francia
 

Similar to Need help with this paperThis assignment consists of writing resea.pdf (20)

Serializing EMF models with Xtext
Serializing EMF models with XtextSerializing EMF models with Xtext
Serializing EMF models with Xtext
 
META-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docx
META-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docxMETA-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docx
META-INFMANIFEST.MFManifest-Version 1.0Created-By 1.8.0_.docx
 
Please read the comment ins codeExpressionTree.java-------------.pdf
Please read the comment ins codeExpressionTree.java-------------.pdfPlease read the comment ins codeExpressionTree.java-------------.pdf
Please read the comment ins codeExpressionTree.java-------------.pdf
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
Antlr V3
Antlr V3Antlr V3
Antlr V3
 
5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе5. Ввод-вывод, доступ к файловой системе
5. Ввод-вывод, доступ к файловой системе
 
write a java program related to Huffman coding.SolutionThe Jav.pdf
write a java program related to Huffman coding.SolutionThe Jav.pdfwrite a java program related to Huffman coding.SolutionThe Jav.pdf
write a java program related to Huffman coding.SolutionThe Jav.pdf
 
C Assignment Help
C Assignment HelpC Assignment Help
C Assignment Help
 
Sysprog17
Sysprog17Sysprog17
Sysprog17
 
Write a program that takes any input text and produces both a frequen.pdf
Write a program that takes any input text and produces both a frequen.pdfWrite a program that takes any input text and produces both a frequen.pdf
Write a program that takes any input text and produces both a frequen.pdf
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command Line
 
Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossum
 
IT6801-Service Oriented Architecture-Unit-2-notes
IT6801-Service Oriented Architecture-Unit-2-notesIT6801-Service Oriented Architecture-Unit-2-notes
IT6801-Service Oriented Architecture-Unit-2-notes
 
5java Io
5java Io5java Io
5java Io
 
Network security Lab manual
Network security Lab manual Network security Lab manual
Network security Lab manual
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESM
 
CountryData.cppEDIT THIS ONE#include fstream #include str.pdf
CountryData.cppEDIT THIS ONE#include fstream #include str.pdfCountryData.cppEDIT THIS ONE#include fstream #include str.pdf
CountryData.cppEDIT THIS ONE#include fstream #include str.pdf
 
Unit 6
Unit 6Unit 6
Unit 6
 
RealmDB for Android
RealmDB for AndroidRealmDB for Android
RealmDB for Android
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them
 

More from sktambifortune

Your company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdfYour company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdfsktambifortune
 
You are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdfYou are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdfsktambifortune
 
CASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdfCASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdfsktambifortune
 
Can you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdfCan you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdfsktambifortune
 
B1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdfB1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdfsktambifortune
 
Assignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdfAssignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdfsktambifortune
 
Any kind of help would gladly be appreciated. (C-programming)Probl.pdf
Any kind of help would gladly be appreciated. (C-programming)Probl.pdfAny kind of help would gladly be appreciated. (C-programming)Probl.pdf
Any kind of help would gladly be appreciated. (C-programming)Probl.pdfsktambifortune
 
Which of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdfWhich of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdfsktambifortune
 
What serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdfWhat serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdfsktambifortune
 
What is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdfWhat is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdfsktambifortune
 
what are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdfwhat are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdfsktambifortune
 
What are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdfWhat are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdfsktambifortune
 
Twitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdfTwitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdfsktambifortune
 
A. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdfA. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdfsktambifortune
 
The Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdfThe Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdfsktambifortune
 
savings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdfsavings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdfsktambifortune
 
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdfQuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdfsktambifortune
 
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdfsktambifortune
 
Prove that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdfProve that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdfsktambifortune
 
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdfsktambifortune
 

More from sktambifortune (20)

Your company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdfYour company is preparing to migrate from IPv4 to IPv6, and you are .pdf
Your company is preparing to migrate from IPv4 to IPv6, and you are .pdf
 
You are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdfYou are burning the latest song you bought on ITunes to a disk. The .pdf
You are burning the latest song you bought on ITunes to a disk. The .pdf
 
CASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdfCASE 3-12 Information System Project Steering Committee The Informat.pdf
CASE 3-12 Information System Project Steering Committee The Informat.pdf
 
Can you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdfCan you date the latest financial crisis in the United States or in .pdf
Can you date the latest financial crisis in the United States or in .pdf
 
B1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdfB1. State the components of organization. Give good examples to justi.pdf
B1. State the components of organization. Give good examples to justi.pdf
 
Assignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdfAssignment of SOS operating systemThe file lmemman.c has one incom.pdf
Assignment of SOS operating systemThe file lmemman.c has one incom.pdf
 
Any kind of help would gladly be appreciated. (C-programming)Probl.pdf
Any kind of help would gladly be appreciated. (C-programming)Probl.pdfAny kind of help would gladly be appreciated. (C-programming)Probl.pdf
Any kind of help would gladly be appreciated. (C-programming)Probl.pdf
 
Which of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdfWhich of the following solutions will turn red litmus blue pOH 1.pdf
Which of the following solutions will turn red litmus blue pOH 1.pdf
 
What serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdfWhat serves as the most reliable source of information about the .pdf
What serves as the most reliable source of information about the .pdf
 
What is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdfWhat is the difference between the terms “earnings and profits” and .pdf
What is the difference between the terms “earnings and profits” and .pdf
 
what are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdfwhat are three effects of transistor scaling on computer architectur.pdf
what are three effects of transistor scaling on computer architectur.pdf
 
What are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdfWhat are some of the motives for employee theft What are some .pdf
What are some of the motives for employee theft What are some .pdf
 
Twitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdfTwitter is a popular social media. It allows its users to exchange tw.pdf
Twitter is a popular social media. It allows its users to exchange tw.pdf
 
A. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdfA. State the domai and ranga. 1. y find the inverse and state the dom.pdf
A. State the domai and ranga. 1. y find the inverse and state the dom.pdf
 
The Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdfThe Puritan faith community shaped the New England colonies in virtu.pdf
The Puritan faith community shaped the New England colonies in virtu.pdf
 
savings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdfsavings account d. the value of the shares is based on the amount of .pdf
savings account d. the value of the shares is based on the amount of .pdf
 
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdfQuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
QuestionIt was reported on June 11, 1997, by NBC Nightly News that.pdf
 
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf946 LTE Labs Le.chateliers-lab.pdf  Before beginning this experiment.pdf
946 LTE Labs Le.chateliers-lab.pdf Before beginning this experiment.pdf
 
Prove that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdfProve that the T_i-property is a topological property for i = 0So.pdf
Prove that the T_i-property is a topological property for i = 0So.pdf
 
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
4. Refer to the table of Gini coefficients in the Added Dimension box.pdf
 

Recently uploaded

Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 

Recently uploaded (20)

Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 

Need help with this paperThis assignment consists of writing resea.pdf

  • 1. Need help with this paper This assignment consists of writing research paper surveying a popular algorithm. Your paper must conform to the American Psychological Association (APA) writing style. There are many good online resources for the APA style.Your paper must use reputable scholarly references. Most Web sources such as blog, forums, and personal website are not considered reputable(do not cite or use any Wiki or Answer.com type websites). Your paper should use 11pt or 12pt font size for the main text. Other text such as figure and table labels and captions, if applicable, should be no smaller then 10pt. A typical research paper for this assignment is about 7-10 double spaced pages (not including the cover page or reference page). Topics: Choose one of the following algorithms areas to write about. Potential algorithm topics related to the algorithm area are included in parenthesis as examples. 1.Hashing Algorithms (e.g.SHA-3;Message Digest-5;Cryptography algorithms such as Advanced Encryption Standard, Blowfish,Elliptic curve cryptography;Digital signature algorithms; Bitcoin Mining) 2.Compression Algorithms (e.g. LZO, Data differencing, Huffman Coding) 3.String Matching (e.g Google’s PageRank algorithm , DNA sequence algorithms, Spell checking algorithms) 4.Memory Management (e.g. Garbage Collection, Buddy Methods, Paging algorithms,Sequential-Fit Methods) Solution public final category Huffman non-public Huffman() ; non-public static category HuffmanNode } non-public static category HuffManComparator implements Comparator<HuffmanNode> come back node1.frequency - node2.frequency; } } /** * Compresses the string victimisation huffman formula. * The huffman tree and also the huffman code area unit serialized to disk *
  • 2. * @param sentence The sentence to be serialized * @throws FileNotFoundException If file isn't found * @throws IOException If IO exception happens. */ public static void compress(String sentence) throws FileNotFoundException, IOException ought to atleast have one character."); } final Map<Character, Integer> charFreq = getCharFrequency(sentence); final HuffmanNode root = buildTree(charFreq); final Map<Character, String> charCode = generateCodes(charFreq.keySet(), root); final String encodedMessage = encodeMessage(charCode, sentence); serializeTree(root); serializeMessage(encodedMessage); } non-public static Map<Character, Integer> getCharFrequency(String sentence) else } come map; } /** * Map<Character, Integer> map * Some implementation of that treeSet is passed as parameter. * @param map */ non-public static HuffmanNode buildTree(Map<Character, Integer> map) whereas (nodeQueue.size() > 1) // take away it to forestall object leak. come nodeQueue.remove(); } non-public static Queue<HuffmanNode> createNodeQueue(Map<Character, Integer> map) return pq; } non-public static Map<Character, String> generateCodes(Set<Character> chars, HuffmanNode node) { final Map<Character, String> map = new HashMap<Character, String>(); doGenerateCode(node, map, "");
  • 3. come map; } non-public static void doGenerateCode(HuffmanNode node, Map<Character, String> map, String s) doGenerateCode(node.left, map, s + '0'); doGenerateCode(node.right, map, s + '1' ); } non-public static String encodeMessage(Map<Character, String> charCode, String sentence) come stringBuilder.toString(); } non-public static void serializeTree(HuffmanNode node) throws FileNotFoundException, IOException attempt (ObjectOutputStream oosTree = new ObjectOutputStream(new FileOutputStream("/Users/ap/Desktop/tree"))) strive (ObjectOutputStream oosChar = new ObjectOutputStream(new FileOutputStream("/Users/ap/Desktop/char"))) soft to mark finish of bit set relevant for deserialization. oosTree.writeObject(bitSet); } } } non-public static category IntObject /* * Algo: * 1. Access the node * 2. Register the worth in bit set. * * * here true and false dont correspond to left branch and right branch. * there, * - true means that "a branch originates from leaf" * - false mens "a branch originates from non-left". * * additionally since branches originate from some node, the foundation node should be provided as supply * or place to begin of initial branches.
  • 4. * * Diagram and the way associate degree bit set would look as a result. * (source node) * / * true true * / * (leaf node) (leaf node) * | | * false false * | | * * thus currently somewhat set appears like [false, true, false, true] * */ non-public static void preOrder(HuffmanNode node, ObjectOutputStream oosChar, BitSet bitSet, IntObject intObject) throws IOException bitSet.set(intObject.bitPosition++, true); // register branch in bitset preOrder(node.left, oosChar, bitSet, intObject); // take the branch. bitSet.set(intObject.bitPosition++, true); // register branch in bitset preOrder(node.right, oosChar, bitSet, intObject); // take the branch. } non-public static void serializeMessage(String message) throws IOException attempt (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("/Users/ap/Desktop/encodedMessage"))) } non-public static BitSet getBitSet(String message) else } bitSet.set(i, true); // dummy bit set to grasp the length come bitSet; } /** * Retrieves back the initial string. * * * @return the initial uncompressed string * @throws FileNotFoundException If the file isn't found
  • 5. * @throws ClassNotFoundException If category isn't found * @throws IOException If IOException happens */ public static String expand() throws FileNotFoundException, ClassNotFoundException, IOException { final HuffmanNode root = deserializeTree(); come decodeMessage(root); } non-public static HuffmanNode deserializeTree() throws FileNotFoundException, IOException, ClassNotFoundException strive (ObjectInputStream oisBranch = new ObjectInputStream(new FileInputStream("/Users/ap/Desktop/tree"))) strive (ObjectInputStream oisChar = new ObjectInputStream(new FileInputStream("/Users/ap/Desktop/char"))) agencyBranch.readObject(); come preOrder(bitSet, oisChar, new IntObject()); } } } /* * Construct a tree from: * input [false, true, false, true, (dummy faithful mark the top of bit set)] * The input is built from preorder traversal * * Algo: * one produce the node. * 2. scan what's registered in bitset, and judge if created node is meant to be a leaf or non-leaf * */ non-public static HuffmanNode preOrder(BitSet bitSet, ObjectInputStream oisChar, IntObject o) throws IOException crucial if created node is that the leaf or non-leaf. if (!bitSet.get(o.bitPosition)) succeeding position to subsequent stack frame by doing computation before preOrder is named. node.ch = oisChar.readChar(); come node; } o.bitPosition = o.bitPosition + 1; // feed subsequent position to subsequent stack frame by doing computation before preOrder is named.
  • 6. node.left = preOrder(bitSet, oisChar, o); o.bitPosition = o.bitPosition + 1; // feed subsequent position to subsequent stack frame by doing computation before preOrder is named. node.right = preOrder(bitSet, oisChar, o); come node; } non-public static String decodeMessage(HuffmanNode node) throws FileNotFoundException, IOException, ClassNotFoundException strive (ObjectInputStream Office of Intelligence Support = new ObjectInputStream(new FileInputStream("/Users/ameya.patil/Desktop/encodedMessage"))) worker = node; // since huffman code generates full binary tree, temp.right is definitely null if temporary worker.left is null. whereas (temp.left != null) { if (!bitSet.get(i)) { temporary worker = temporary worker.left; } else { temporary worker = temporary worker.right; } i = i + 1; } stringBuilder.append(temp.ch); } come stringBuilder.toString(); } } public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException range of characters Huffman.compress("some"); Assert.assertEquals("some", Huffman.expand()); // odd range of characters Huffman.compress("someday"); Assert.assertEquals("someday", Huffman.expand()); // continuance even range of characters + area + non-ascii Huffman.compress("some some#"); Assert.assertEquals("some some#", Huffman.expand()); // odd range of characters + area + non-ascii