Java Assignment | PROGRAMMING ASSIGNMENT
PROGRAMMING ASSIGNMENT
项目类别:计算机
Hello, dear friend, you can consult us at any time if you have any questions, add  WeChat:  zz-x2580

VERY IMPORTANT
• Your code should be well commented:
Add your name and email address at the beginning of each .java file.
Write comments within your code when needed.
You must use Javadoc comments for your classes and methods.
In each method’s Javadoc header, include its running time.
• Before submitting your assignment you must zip all your files.
The ZIP file must have the naming convention LastnameFirstname-PA2.zip
• Submit your assignment on LATTE using the assignment submission link.
• You may only use data structures that you implement yourself.
You may not use arrays.
Your data structure should not have hardcoded data types. You should use generics.

The Secret Message
You are a secret agent working for the infamous Brandeis Spy Network.
You’ve received a secret message from your leader, the Professor, in the format of insert statements into an AVL binary search tree.

Your mission is to implement a structure that will perform the specified insertions, so that you can print the postorder traversal of the final, balanced tree, and read the secret message.

You must implement an AVL Binary Search Tree in which each node stores a value. The structure of the tree should be determined by the natural ordering of the values. Natural ordering is when a series of elements are sorted automatically according to their compareTo()method. Thus, your data structure should be of type:
BinarySearchTree<E extends Comparable<E>>.

The insertions in the secret message will be of type DataElement<String>, but you should use generics so that a user can instantiate your tree with any type that extends Comparable.

Besides implementing the following methods, implement any helper methods necessary for your program.

hasLeft( ): returns true if the tree has a left child.
hasRight( ): returns true is the tree has a right child.
isLeaf( ): returns true if the tree is a leaf (has no children).
isEmpty( ): returns true if the tree is empty (doesn’t have a root).
isRoot( ): returns true if the tree has no parent.
isLeftChild( ): returns true if the tree is a left child of its parent.

isRightChild( ): returns true if the tree is a right child of its parent.
hasParent( ): returns true if the tree has a parent.
findNode(E e): returns the node that contains e, or null.
findMin( ): returns the node with the minimum value in the tree.
findSuccessor( ): returns the node that is the successor to the current node.

留学ICU™️ 留学生辅助指导品牌
在线客服 7*24 全天为您提供咨询服务
咨询电话(全球): +86 17530857517
客服QQ:2405269519
微信咨询:zz-x2580
关于我们
微信订阅号
© 2012-2021 ABC网站 站点地图:Google Sitemap | 服务条款 | 隐私政策
提示:ABC网站所开展服务及提供的文稿基于客户所提供资料,客户可用于研究目的等方面,本机构不鼓励、不提倡任何学术欺诈行为。