Hi can any one solve this problem using perl? it would be great if u can send me the solution via email
Word Counting
Write a program that counts the number of times each unique word appears in the Gettysburg Address speech below.
But, in a larger sense, we can not dedicate—we can not consecrate—-we can not hallow—-this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us — that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion — that we here highly resolve that these dead shall not have died in vain — that this nation, under God, shall have a new birth of freedom — and that government of the people, by the people, for the people, shall not perish from the earth.
As output, have your program display (to stdout or a file):
Here the input text for a smaller example:
this is a bit of text and this text is short text
Here is the output of a correct program based on this example:
this: 2 is: 2 a: 1 bit: 2 of: 2 text: 3 and: 1 short: 1 Maximum: text (3) Minimum: a, and, short (1) Average occurrences: 1.75
Later overwritten with:
Hi.
This is a problem of the infamous LCA in binary trees..!
I heard that this can be easily implemented in perl using a CPAN module called "bioperl".
I have never used it ..so have no idea.
if any one knows , or used it before..if they can write a small program for the below program..it would be great.
Thanks
Find Common Parent
A) Write a class for a "Doubly-Linked" Tree; child nodes have links to their parents and vice versa (whatever the proper term is for such a tree). This tree can be a binary tree, for simplicity, and should only have one root node.
B) Using the above class, write a subroutine, common_parent(node1, node2), which return the first parent node that the two nodes have in common. Example:
A / \ B C / \ \ D E F / G first_common_parent(F, D) = A
20071129 Janitored by Corion: Restored original content, added formatting, code tags, as per Writeup Formatting Tips
In reply to How to count no of words in a text input file? by vikramkone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |