Two parts explained below, must provide javadoc(explanation in the code) and junit test
Part 1: Create a class Person with the three field variables String name, String gender, andint age. Build a recursive structure DoublyLinkedList of persons with corresponding constructors, getters (in particular left() and right() returning the left and the right sub-list, respectively), setters, a toString method, and an equals method. When you add elements to a doubly linked list put them always to the front, that is, write a method so that cons(tom, cons(ann, cons(joe, cons(mary, cons(tim, empty()))))) gener- ates the list displayed above (with appropriately generated objects such as Person tom = new Person("Tom", "M", 22);.) Write a method that checks for an element in the dou- bly linked list whether all their neighbours are of the opposite gender (i.e. for inner list members whether the left and the right neighbours are, and for the leftmost/rightmost whether the right/left neighbour is, respectively).
Part 2: Use the Person class from the previous exercise and build a binary search tree of persons ordered by the name (in a class BinarySearchPerson). That is, when a new person is inserted into an empty tree then it should be put as the value, if the element is smaller than the value it should be inserted into the left sub-tree, if it is equal to the value it should be ignored, and if it is bigger than the value it should be inserted into the right subtree. The tree should be built following the lexicographical order of the String representing the name of the Person. Note, however, that you should not insert strings into the tree, but objects of type Person.
Two strings can be compared with respect to the lexicographical order by the compareTo method. For two strings str1 and str2 we have [url removed, login to view](str2) returns an int less than 0 if str1 comes before str2 in the lexicographical order; it is equal to 0 if the strings are equal; and it is bigger than 0 if str2 comes before str1 in the lexicographical order. (E.g., "abc" comes before "xyz", likewise "abc" before "abxy". Shorter strings with the same start before longer ones, e.g., "ab" before "abc". It is the order that is used in a lexicon.)
Write a method lookupAge(String name) which searches in the binary search tree for a person with name name and returns their age if such a person is found. It should return-1 if no such person is found.
16 freelancers estão ofertando em média $101 para esse trabalho
HI Contact me for an efficient, perfect, well documented development of your project according to 100% accuracy and requirements, with dedicated support. Thanks Farah Saif
Hello, I can get you both the programs done with proper Java Doc and Junit testcase. I can gurantee you to deliver the work within 24 to 48 hours. Let me know if you are interested. Thanks
Hello, I can deliver this project in 2-3 dayx max. I am confident that I will provide the best source code quality in time. If you are interested, please ping me before award. Best, Alex
hello........i have read the requirements.......i have very good knowledge............i can complete your work on time..........message me...waiting for your response...........thanks & regards
Hi, I have previously worked with many java projects. I am sure to meet the requirements mentioned. Looking forward for your reply, regards, Nittile Gupta