Writing a brief description of the algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM131428977

Assignment -

Question 1: Property of Binary Trees

Assume a proper and complete binary tree (T) with n > 1 nodes. Let E(T) represent the sum of the depths of all external nodes in T (see Figure1), and I(T) represent the sum of the depths of all internal nodes in T. Prove that: 

(a) E(T) = O(n⋅log(n)) 

(b) E(T) - I(T) = 2i,  where i represents the actual number of internal nodes in T.

914_Figure.png

Question 2: Binary Search Tree

Given a BST and two numbers - a and b (where a ≤ b) - propose an algorithm that prints all the elements k of the BST that satisfy: k ≥ a and k ≤ b. Your algorithm should return the found keys in ascending order. You can assume that there are no duplicate keys in the tree. (You can also assume that a, b, and all the keys stored in the BST are integers.)

In addition to writing a brief description of the algorithm, you also need to implement the algorithm in Java (i.e., provide respective Java code), as well as justify the algorithm's running time.

Question 3: BST-based Text Analyzer 

In this project, you are required to write a program that builds a binary search tree (BST) of distinct words from an input text file. Each time a new word occurs in the text, it is inserted into the tree; if the word has previously occurred, a count associated with the word is incremented. (Note: you will have to parse the text obtained from the file to find the words before inserting them into the tree. Furthermore, you will have to replace all capital letters with their lower-case equivalents and remove punctuation.) 

Once all words are inserted into the BST, the following three experiments should be performed.

1) Compute the maximum length of all search paths in the BST. 

2) Print all distinct words found in the text (in sorted/alphabetic order). 

3) Find the ten most common words in the text. You should output both the word and the number of times it occurred.

Your program design should be based on the following guidelines: 

(1) Create BTNode1 class, which will be used to store each distinct word together with is occurrence-counter (wordCounter). The outline of this class is given below. 

(2) Create LinkedBinaryTree class as outlined in the textbook and class-notes.

(3) Create BinarySearchTree class (extends  LinkedBinaryTree), which will be used to store all distinct words form a given file. The outline of this class is given below. You are allowed to add new variables and methods to this class, as needed.

(4) Create TextAnalyzer class, which will contain main() method and act as a tester class. The outline of this class is given below. You are allowed to add new methods to this class, as needed.

Attachment:- Assignment Files.rar

Reference no: EM131428977

Questions Cloud

Reasonable assumptions and future projections : By making reasonable assumptions and future projections, can you find the NPV of your graduate studies? Why or why not?
Compute the annualized irr for loan : Suppose the index rate will remain 1% for the life of the loan. Compute the annualized IRR for this loan assuming Tim will prepay in 5 years.
Can hispanic consumers be targeted in one consumer segment : Can Hispanic consumers be targeted in one consumer segment or are there differences among them that need to be considered?
Discuss characters neurotic needs and trends : Discuss character's neurotic needs and trends - what do you think has happened in his/her life that has led to these behaviors?
Writing a brief description of the algorithm : Given a BST and two numbers - a and b (where a ≤ b) - propose an algorithm that prints all the elements k of the BST that satisfy: k ≥ a and k ≤ b. Writing a brief description of the algorithm
Identify the key health and mental health needs community : The scenario is that a donor in the community wants to give $1,000,000 to address a priority health need or issue in the area. As a community health planner, you have been asked to write a 3-page proposal to make a case for your community to get ..
Net present value of the project : A project has an initial outlay of $3,478. It has a single payoff at the end of year 8 of $8,156. What is the net present value (NPV) of the project if the company's cost of capital is 11.56 percent?
What is the angle of this light ray when it enters the water : What would be the refracted angle if the ray entered the water directly? Express your answer using three significant figures.
Brief compare and contrast analysis of the two pieces : Provide a summary of what message each writer is trying to get across, and provide a brief compare and contrast analysis of the two pieces. Explain which piece you feel is more effective and why. Be sure to include links for each article in your a..

Reviews

len1428977

3/16/2017 2:33:08 AM

Topic: data structures in java. Detailed Question: please provide all details of the work, no shortcuts please. In addition to writing a brief description of the algorithm, you also need to implement the algorithm in Java (i.e., provide respective Java code), as well as justify the algorithm's running time.

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd