GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Given the following classes SortedLinkedDataList class, Data…

Given the following classes SortedLinkedDataList class, Data class and DataNode class: You may assume that the code indicated by the …s is correctly completed code that you do not need to worry about.  Part 1. Complete the private method recursiveRemoveElement(DataNode pNode, Data pData) such that it will recursively search the list. If there is a node in the list that contains the same information as in the pData argument object, it will return the node’s Data object and remove the node from the SortedLinkedDataList. If the SortedLinkedDataList does not have a node that contains the same information as in the pData argument object, it will return null. You may assume that the SortedLinkedDataList is a sorted list, in ascending order. Your search and removal must be efficient. At least as efficient as it can be given that you are using a linked list. (20 points) Part 2. Given the same classes as above, complete the recursive private method printInReverseRecursive, that displays to the terminal window the information from the list in reverse order. (10 points) Part 3. Given the following RandomList class, that is implemented using an unbound array, complete the two methods: randomAdd(Data pData) that adds a Data element into a random location in the list. (10 points) randomGet() that retrieves and removes a random element from the list. If the list is empty return null. (10 Points) Do not worry about how the list’s array is expanded. Your solutions must run in constant time. This means that the time it take to add or remove an element from the list is independent of the number of elements in the list. There is a little quibbling about this when it becomes necessary to expand the array. Do not worry about the cost of expanding the array. The key to implementing these two methods, with constant time algorithms, is that the list is unsorted. Use int(Math.random() * size) to generate a random index. class Data{ … public boolean equals(Data pData){ boolean isEqual = true; … return isEqual;} public int compareTo(Data pData){ int compareValue = 0; … return compareValue ;} public toString(){ String dataString = null; … return dataString ;}}class DataNode implements Comparable{ private Data data = null; private DataNode link = null; … public Data getData(){ return data;} public boolean equals(DataNode pDataNode){ return this.data.equals(pDataNode.getData());} public int compareTo(DataNode pDataNode){    return this.getData().compareTo(pDataNode.getData());}} class SortedLinkedDataList{ private DataNode head = null; private DataNode tail = null; private size = 0; … public data removeElement(Data pData){ return recursiveRemoveElement(null, head, pData);} private Data recursiveRemoveElement(DataNode pPrevNode, DataNode pNode, Data pData){ //ToDo } public void printListInReverse(){ printInReverseRecursive(head);} private void printInReverseRecursive(DataNode pNode);{ //ToDo }}class RandomList{ private Data[] randomList = null; int size = 0; … public boolean isEmpty(){ return size == 0; public boolean isFull(){ if( size == randomList.length ){ expandList(); return false; private void expandList(){…} public Data randomGet(){ //toDo } public void randomAdd(Data pData){ //toDo }}  

Read Details

You have completed the Final Exam for PTA/152 – Cardiopulmon…

You have completed the Final Exam for PTA/152 – Cardiopulmonary Rehabilitation, Congratulations! Before you continue reading, please make sure you have answered all the questions in this exam. It was my honor & pleasure to help instruct all of you these past 3 semesters. I have always believed it is both the expectation and the right of each class to raise the bar higher than the class before it. As each class graduates, the expectations, quality, and skill also rise.   It is without question this class has elevated the bar significantly.   After this exam is submitted, you should spend some time reflecting on this. This message is ‘2 points extra credit’, but I just wanted to tell all of you how much I have enjoyed teaching all of you.If you wish to do so, you may leave comments on the answer box below. Any comments on what you enjoyed in this particular course or any course we had in the past. You may comment on anything from teaching techniques to content layout & organization to even future ideas. I have taken all these ideas, concepts, feedback, and woven them in throughout the years. Cardiopulmonary’s Strength is its ability to improve, which I have used to also strengthen the first-year courses. Oh! If you can add a comment if the “Case Scenario Preparation Guide” was useful for you.   You could also just leave this blank and just hit submit.   Please remember as you leave the room, other students are still taking their exams. Please show them & myself your highest level of respect by discreetly leaving the class as not to disturb them. We’ll all come back together for one last time in the Spring, for PTA/170!

Read Details

26. Which of the following is the CORRECT setup for postural…

26. Which of the following is the CORRECT setup for postural drainage for the: Right Middle Lobe?

Read Details

95. A PTA instructs a patient regarding the Astrand-Rhyming…

95. A PTA instructs a patient regarding the Astrand-Rhyming Bicycle Protocol for a graded exercise test. At minute 5 the bpm is 127bpm at minute 6 it is 153bpm. At this point in time, what is the most logical course of ACTION?  

Read Details

72. Which tube/line is BEST distinguished by being able to p…

72. Which tube/line is BEST distinguished by being able to provide total parenteral nutrition but is also intravenous through the jugular or brachial vein with destination to the right atrium?  

Read Details

87. A PTA observes an EKG of a patient on beta-blockers. Whi…

87. A PTA observes an EKG of a patient on beta-blockers. Which of the following EKG changes could be facilitated by beta-blockers?  

Read Details

54. Which of the following reasons is the MOST likely reason…

54. Which of the following reasons is the MOST likely reason why patients assume the ‘tripod position”?

Read Details

43. Using the included photo, please identify the lung volum…

43. Using the included photo, please identify the lung volume or capacity identified by the letter ‘A’.

Read Details

65. Which of the following cardiac abnormalities is MOST lik…

65. Which of the following cardiac abnormalities is MOST likely to results in a delay in the AV node, causing a slow ventricular rate?  

Read Details

73. Which of the following devices will MOST likely be used…

73. Which of the following devices will MOST likely be used AFTER the removal of a pulmonary tumor that caused a a collapsed lung?  

Read Details

Posts pagination

Newer posts 1 … 31,329 31,330 31,331 31,332 31,333 … 99,624 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top