Advanced Data Structures:1 DrugBank and Drug DesignIn this assignment, we play with the DrugBank data using heap. You are expected to finish the following tasks.2 Your Tasks (Total: 8...

1 answer below »
Hello there, please please please read the pdf attached properly and please solve before the due date. I need 100% correct solution to this. Please don't forget to comment for understanding. Thank You!


Advanced Data Structures: 1 DrugBank and Drug Design In this assignment, we play with the DrugBank data using heap. You are expected to finish the following tasks. 2 Your Tasks (Total: 8 marks) You should define classes named Drug and DrugHeap with the following requirements (feel free to define extra variables, classes, and methods if needed). Please note that, DrugHeap is actually a class for min-heap. 1. Define the class Drug with data attributes drugBankID, (this is used as key), genericName, SMILES, url, drugGroups, and score. This class has at least one method, named displayDrug to print out the information on the screen. (0.5 mark) 2. Define a method named readData under the DrugHeap class to load all the provided information from the given text file to an array variable (named data which is an attribute of the class). (0.5 mark) 3. Define a method named trickleDown (int i) under the DrugHeap class to trickle down the i-th node in the heap to restore heap-order, where i is the index of an object in the array. (1 mark) 4. Define a method named buildHeap under the DrugHeap class to convert the array data into a heap.(1 mark) 5. Define a method named removeMin under the DrugHeap class to remove the Drug object with the minimal key. (1 mark) 6. Define a recursive method named inOrderTraverse under the DrugHeap class to perform inorder traversal over the nodes in the heap. In this method, you should write your results into a text file named dockedApprovedInOrder.tab where each row contains the information of a drug with same format as the given text file. (1 mark) 7. Define a method named heapSort under the DrugHeap class to sort the Drug objects in array data. Note that, you should not save the result in array data. Instead, you should save the result in a text file named dockedApprovedSorted.tab which has the same format as the given text file. (2 mark) 8. In the main function, instance (named dh) of the DrugHeap should be created. The following methods of this instance should be called sequentially: (a) dh.buildHeap() (b) dh.inOrderTraverse() (c) db.heapSort() , (0.5 mark) 9. Your code should be well commented. (0.5 mark) 1 3 Submission • Your source code. • A PDF printout of your source code. • Output text files dockedApprovedInOrder.tab (from Task 6) and dockedApprovedSorted.tab (from Task 7). • If any of the above require files are not submitted, 0 mark will be given to the whole assignment. • Late submissions will not be accepted. 2
Answered Same DayOct 31, 2022

Answer To: Advanced Data Structures:1 DrugBank and Drug DesignIn this assignment, we play with the DrugBank...

Vikas answered on Nov 01 2022
49 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here