1- Use LinkList. Write removeLast(n). Delete the last occurrence of an item from a linked list. So if the item is 7 and the list is [1,3,7,4,7,3,7,2], the result is [1,3,7,4,7,3,2]
2- Use LinkList. Write removeAll(int
n). Deletes all occurrences of an item n from a linked
list. So if the item is 7 and the list1 is [1,3,7,4,7,3,2] , then
list1.removeAll(7) then list1 becomes [1,3,4,3,2].
Demonstrate by displaying the list contents before
and after calling the above methods. Eg:
lst1
[1,3,7,4,7,3,7,2]
lst1.removelast(7)
[1,3,7,4,7,3,2]
lst1.removeall(7)
[1,3,4,3,2]
------------------------------------------------------------------------------------------------------------------------------------------------------------------
// linkList.java
// demonstrates linked list
// to run this program: C>java LinkListApp
////////////////////////////////////////////////////////////////
class Link
{
public int iData; // data item
public double dData; // data item
public Link next; // next link in list
//
-------------------------------------------------------------
public Link(int id, double dd) // constructor
{
iData = id; // initialize data
dData = dd; // ('next' is automatically
} // set to null)
//
-------------------------------------------------------------
public void displayLink() // display ourself
{
System.out.print("{" + iData + ", " + dData + "} ");
}
} // end class Link
////////////////////////////////////////////////////////////////
class LinkList
{
private Link first; // ref to first link on list
//
-------------------------------------------------------------
public LinkList() // constructor
{
first = null; // no links on list yet
}
//
-------------------------------------------------------------
public boolean isEmpty() // true if list is empty
{
return (first==null);
}
//
-------------------------------------------------------------
// insert at start of list
public void insertFirst(int id, double dd)
{ // make new link
Link newLink = new Link(id, dd);
newLink.next = first; // newLink --> old first
first = newLink; // first --> newLink
}
//
-------------------------------------------------------------
public Link deleteFirst() // delete first item
{ // (assumes list not empty)
Link temp = first; // save reference to link
first = first.next; // delete it: first-->old next
return temp; // return deleted link
}
//
-------------------------------------------------------------
public void displayList()
{
System.out.print("List (first-->last): ");
Link current = first; // start at beginning of list
while(current != null) // until end of list,
{
current.displayLink(); // print data
current = current.next; // move to next link
}
System.out.println("");
}
//
-------------------------------------------------------------
} // end class LinkList
////////////////////////////////////////////////////////////////
class LinkListApp
{
public static void main(String[] args)
{
LinkList theList = new LinkList(); // make new list
theList.insertFirst(22, 2.99); // insert four items
theList.insertFirst(44, 4.99);
theList.insertFirst(66, 6.99);
theList.insertFirst(88, 8.99);
theList.displayList(); // display list
while( !theList.isEmpty() ) // until it's empty,
{
Link aLink = theList.deleteFirst(); // delete link
System.out.print("Deleted "); // display it
aLink.displayLink();
System.out.println("");
}
theList.displayList(); // display list
} // end main()
} // end class LinkListApp
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Class LinkListAppTest.Java is just for testing. Please do not edit in any form.
class LinkListAppTest
{
public static void main(String[] args) // NEW MAIN
{
LinkList lst1 = new LinkList(); // Since the available add method is a pre-add to the first we go in reverse order
lst1.insertFirst(8,2); // last digit
lst1.insertFirst(7,7); // entering next to last
lst1.insertFirst(6,3); // until we get to the the beginning
lst1.insertFirst(5,7);
lst1.insertFirst(4,4);
lst1.insertFirst(3,7);
lst1.insertFirst(2,3);
lst1.insertFirst(1,1);
System.out.println("lst1"); // list the name of the linked-list
lst1.displayList(); // pre-print the entered list unaltered
System.out.println("lst1.removeLast(7)"); // list the action to be taken
lst1.removeLast(7); // complete the action to remove the last dData == 7;
lst1.displayList(); // print list post removal of the last dData == 7;
System.out.println("1st1.removeAll(7)"); // list the action to be taken
lst1.removeAll(7); // complete the action to remove all remaining dData == 7;
lst1.displayList(); // print list post removal of all remaining dData == 7;
} // end main()
} // end class In: Computer Science
1- Use LinkList. Write removeLast(n). Delete the last occurrence of an item from a linked list. So if the item is 7 and the list is [1,3,7,4,7,3,7,2], the result is [1,3,7,4,7,3,2]
2- Use LinkList. Write removeAll(int
n). Deletes all occurrences of an item n from a linked
list. So if the item is 7 and the list1 is [1,3,7,4,7,3,2] , then
list1.removeAll(7) then list1 becomes [1,3,4,3,2].
Demonstrate by displaying the list contents before
and after calling the above methods. Eg:
lst1
[1,3,7,4,7,3,7,2]
lst1.removelast(7)
[1,3,7,4,7,3,2]
lst1.removeall(7)
[1,3,4,3,2]
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// linkList.java
// demonstrates linked list
// to run this program: C>java LinkListApp
////////////////////////////////////////////////////////////////
class Link
{
public int iData; // data item
public double dData; // data item
public Link next; // next link in list
//
-------------------------------------------------------------
public Link(int id, double dd) // constructor
{
iData = id; // initialize data
dData = dd; // ('next' is automatically
} // set to null)
//
-------------------------------------------------------------
public void displayLink() // display ourself
{
System.out.print("{" + iData + ", " + dData + "} ");
}
} // end class Link
////////////////////////////////////////////////////////////////
class LinkList
{
private Link first; // ref to first link on list
//
-------------------------------------------------------------
public LinkList() // constructor
{
first = null; // no links on list yet
}
//
-------------------------------------------------------------
public boolean isEmpty() // true if list is empty
{
return (first==null);
}
//
-------------------------------------------------------------
// insert at start of list
public void insertFirst(int id, double dd)
{ // make new link
Link newLink = new Link(id, dd);
newLink.next = first; // newLink --> old first
first = newLink; // first --> newLink
}
//
-------------------------------------------------------------
public Link deleteFirst() // delete first item
{ // (assumes list not empty)
Link temp = first; // save reference to link
first = first.next; // delete it: first-->old next
return temp; // return deleted link
}
//
-------------------------------------------------------------
public void displayList()
{
System.out.print("List (first-->last): ");
Link current = first; // start at beginning of list
while(current != null) // until end of list,
{
current.displayLink(); // print data
current = current.next; // move to next link
}
System.out.println("");
}
//
-------------------------------------------------------------
} // end class LinkList
////////////////////////////////////////////////////////////////
class LinkListApp
{
public static void main(String[] args)
{
LinkList theList = new LinkList(); // make new list
theList.insertFirst(22, 2.99); // insert four items
theList.insertFirst(44, 4.99);
theList.insertFirst(66, 6.99);
theList.insertFirst(88, 8.99);
theList.displayList(); // display list
while( !theList.isEmpty() ) // until it's empty,
{
Link aLink = theList.deleteFirst(); // delete link
System.out.print("Deleted "); // display it
aLink.displayLink();
System.out.println("");
}
theList.displayList(); // display list
} // end main()
} // end class LinkListApp
////////////////////////////////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Class LinkListAppTest.Java is just for testing. Please do not edit.
class LinkListAppTest
{
public static void main(String[] args) // NEW MAIN
{
LinkList lst1 = new LinkList(); // Since the available add method is a pre-add to the first we go in reverse order
lst1.insertFirst(8,2); // last digit
lst1.insertFirst(7,7); // entering next to last
lst1.insertFirst(6,3); // until we get to the the beginning
lst1.insertFirst(5,7);
lst1.insertFirst(4,4);
lst1.insertFirst(3,7);
lst1.insertFirst(2,3);
lst1.insertFirst(1,1);
System.out.println("lst1"); // list the name of the linked-list
lst1.displayList(); // pre-print the entered list unaltered
System.out.println("lst1.removeLast(7)"); // list the action to be taken
lst1.removeLast(7); // complete the action to remove the last dData == 7;
lst1.displayList(); // print list post removal of the last dData == 7;
System.out.println("1st1.removeAll(7)"); // list the action to be taken
lst1.removeAll(7); // complete the action to remove all remaining dData == 7;
lst1.displayList(); // print list post removal of all remaining dData == 7;
} // end main()
} // end class In: Computer Science
What are the functions of the Respiratory System?
Please give detail.
What are the parts of the Respiratory
System?
List one Disease of the Respiratory System. Give
detail of what it is and list the ICD-10-CM Code for it.
Construct a Case Study for a Patient using the
Respiratory System. You will come up with a least a paragraph
detail of the patient incident with the Respiratory System. You
will list an ICD-10-CM Code, CPT Code, and a HCPCS Code for the
Case Scenario. Next to the codes that you list you must list the
description of the code.
In: Nursing
Create a static method with the appropriate inputs and outputs. Call each of them in the main method.
Write a method named allMultiples() which takes in a List of integers and an int. The method returns a new List of integers which contains all of the numbers from the input list which are multiples of the given int. For example, if the List is [1, 25, 2, 5, 30, 19, 57, 2, 25] and 5 was provided, the new list should contain [25, 5, 30, 25].
Please do this in Java.
In: Computer Science
For the following description of data, identify the W's, name the variables, specify for each variable whether its use indicates it should be treated as categorical orquantitative, and for any quantitative variable identify the units in which it was measured (or note that they were not provided). Specify whether the data come from a designed survey or experiment. Are the variables time series or cross-sectional? Report any concerns you have as well.
An electronics manufacturerelectronics manufacturer wants to know what college students think about how peoplehow people
access the Internetaccess the Internet. They ask you to conduct a survey that asks students, "Do you think there will be more
smartphonessmartphones or tabletsor tablets used toused to access the Internet in 2025?" and "How likely are you to
use a tablet as your main Internet link in the next 10years?" (scale of 1equals=not at all likely to 5equals=very likely).
Who was measured?
A. The tabletstablets
B. The college students
C. The electronics manufacturerelectronics manufacturer
D. This information is not given.
What was measured? Select all that apply.
A. The likelihood of using a tablet
B. The cost of how peoplehow people access the Internet
C. Number of college students
D. The opinion about how peoplehow people access the Internet in 2025
When were the measurements taken?
A. Last year
B. In 2025
C. Recently
D. This information is not given.
Where were measurements taken?
A. Through the mail
B. At the electronics manufacturerelectronics manufacturer
C. At the college
D. This information is not given.
Why were the measurements taken?
A.The electronics manufacturerelectronics manufacturer wants to know what college students think.
B. The electronics manufacturerelectronics manufacturer wants to know about how people access the Internet.
C.The college students want to know about how people access the Internet
D. This information is not given.
How were the measurements taken?
A. The data was provided by the college.
B. By observation
C. A survey
D. This information is not given.
Specify the categorical variables for this problem. Select all that apply.
A. The likelihood of using a tablet
B. The opinion about how people access the Internetin 2025
C. The number of years until 2025
D. The cost of how peoplehow people access the Internet
E.Number of college students
F. There are no categorical variables.
Specify the quantitative variables and identify the units for this problem. Select all that apply.
A. The likelihood of using a tablet; the units are not specified
B. The opinion about how people access the Internet in 2025; the units are not specified
C. Number of college students; the units are students
D. The number of years until 2025; the units are years
E. The cost of how peoplehow people access the Internet;the units are not specified
F. There are no quantitative variables.
Specify whether the data come from a designed survey or experiment.
A. Designed survey
B. Experiment
C. This information cannot be determined by the given data.
Are the variables time series or cross-sectional?
Time series
Cross-sectional
Neither
Specify any concerns. Select all that apply.
A. The data collection was done incorrectly.
B. There are too many categorical variables.
C. The data sample size was too small.
D. There are no specific concerns.
In: Statistics and Probability
15) Suppose that the amount of time required to perfectly cook a waffle is known to be normally distributed, with mean of 236 seconds and variance of 5 seconds squared. (Note: I'm just making this up for the sake of this question, please don't ruin your waffles cooking them this way) What z-score would you use to find the probability that a waffle will be perfectly cooked in 236 seconds or less? (Round your answer to two decimal points)
16)Suppose you have no idea how the amount of time required to perfectly cook a pancake is distributed, so you measure the cooking time for a sample of 138 random pancakes (cooked under identical conditions) and find that the average cooking time for this sample was 90 seconds, and the sample standard deviation of the cooking times for this group of 138 pancakes was 23 seconds.
Your friend believes that the true average cooking time for pancakes is 91 secondsand wants you to use your new stats skills (and this pancake data) to test the null-hypothesis that the true mean is 91 seconds, given your observed sample mean of 90 seconds.
What is the absolute value of the t-stat is associated with this hypothesis test? (Enter only a positive number)
17) Suppose you have no idea how the amount of time required to perfectly cook a pancake is distributed, so you measure the cooking time for a sample of 141 random pancakes (cooked under identical conditions) and find that the average cooking time for this sample was 96 seconds, and the sample standard deviation of the cooking times for this group of 141 pancakes was 21 seconds.
Construct a 95% confidence interval around your estimated sample mean (using +/- 1.96 standard errors as your cutoffs). What is the value of the lower end of this confidence interval?
18)Suppose you have no idea how the amount of time required to perfectly cook a pancake is distributed, so you measure the cooking time for a sample of 128 random pancakes (cooked under identical conditions) and find that the average cooking time for this sample was 95 seconds, and the sample standard deviation of the cooking times for this group of 128 pancakes was 24 seconds.
What is the standard error for your mean cooking time estimate?
19)
Suppose you have surveyed 146 random CSUCI students and 101 random CSUN students to learn about how much time they spend looking for parking on their respective campuses.
The sample mean for CSUCI students is 14 minutes, with sample standard deviation of 4 minutes.
The sample mean for CSUN students is 16 minutes, with a sample standard deviation of 6 minutes.
Test the null-hypothesis that the true average parking time for students at both campuses is the same. What is the absolute value of the t-statistic is associated with this hypothesis? (Enter a positive number)
20)
Suppose you have surveyed 119 random CSUCI students and 149 random CSUN students to learn about how much time they spend looking for parking on their respective campuses.
The sample mean for CSUCI students is 23 minutes, with sample standard deviation of 7 minutes.
The sample mean for CSUN students is 20 minutes, with a sample standard deviation of 6 minutes.
What is the standard error of the difference in mean parking-search times?
In: Statistics and Probability
Hastings Elementary School (HESH E S) is a K–5 K through 5school with 700 students. The school leader has been asked by the district superintendent to analyze the school’s most recent state-mandated assessment results to develop goals for school improvement. The school leader analyzes the assessment results for grades three through five, comparing the results with the state’s proficiency goals for all students and all student groups, to identify areas in need of improvement. State Proficiency Goals for All Students and All Student Groups Percent Proficient and Above Grade Reading Mathematics Third 65 70 Fourth 65 70 Fifth 65 70 District Vision Our vision is to ensure that all students receive an exemplary educational experience that will allow them to be competitive and productive citizens. School Goal Hastings Elementary School will meet or exceed state proficiency levels for all test grade levels. Hastings Elementary School State-Mandated Assessment Results Percent Proficient and Above All Students Special Education Students English Learners Grade Reading Mathematics Reading Mathematics Reading Mathematics Third 64 70 65 70 50 65 Fourth 70 75 60 60 55 70 Fifth 75 80 65 65 65 70 Mathematics/Reading Faculty Survey Statements Agree Disagree 1. The school’s vision and goal development process provides effective guidance for school improvement. 46% 54% 2. The school’s vision and goal monitoring process provides effective guidance and motivation for me. 55% 45% 3. I am meeting the needs of all students in my classroom. 50% 50% 4. I have sufficient resources to meet the needs of my students. 70% 30% 5. Professional development has met my educational needs. 52% 48% 6. My grade-level team meetings help improve my teaching. 75% 25% 7. My grade-level team regularly reviews mathematics and reading formative assessment results to determine trends in student misconceptions and adjust instruction. 44% 56% 8. I would benefit from additional support for improvement. 65% 35% Open-ended comments made by five or more teachers. Students receiving special education services through inclusion are sometimes struggling—not sure what to do to help them. I love using team meetings to take care of logistics, share best practices, and create common lesson plans. I struggle with the language barriers when working with my EL E Lstudents, and I’m not sure how to determine what they need next. The school leaders provide goals and choose professional development (PDP D), but sometimes I wonder why these are our goals and where the ideas for PD P Dcame from. Question Citing the data, identify and justify THREE specific goals for school improvement that the school leader should establish. For EACH goal, describe a strategy the school leader should implement and explain how the strategy will help the school leader accomplish the goal.
In: Psychology
In C++ please:
In this lab we will creating two linked list classes: one that is a singly linked list, and another that is a doubly linked list ( This will be good practice for your next homework assignment where you will build your own string class using arrays and linked list ) .
These LinkedList classes should both be generic classes. and should contain the following methods:
Add - Adds element to the end of the linked list.
IsEmpty
Push - Adds element to the beginning of the linked list
InsertAt - Inserts an element at a given position
Clear - Removes all elements from the linked list
Contains - Returns true if element is in the linked list
Get - Returns a value at a specific position
IndexOf - Returns the first position where an element occurs, -1 if not
LastOf - Returns the last position where an element occurs, -1 if not
Remove - Removes the last item added to the list
RemoveAt - Removes an element at a specific position
RemoveElement - Removes the first occurrence of a specific element
Size
Slice - Returns a subset of this linked list given a beginning position start and end position stop.
You will also count the number of operations that is performed in each method and will calculate the RUN-TIME of each method, as well as calculating the BIG O, OMEGA and THETA notation of each method. This information should be written in a comment block before each method ( you may count the number of operations on each line if you want ).
In: Computer Science
C++ language.
struct Node
{
int data;
Node *next;
}
Write a function to concatenate two linked lists. Given lists A* = (4, 6) and B* = (3, 7, 12), after return from Concatenate_Lists(Node A*, Node B*) the list A should be changed to be A = (4, 6, 3, 7, 12). Your function should not change B and should not directly link nodes from A to B (i.e. the nodes inserted into A should be copies of the nodes from B.)
Write a function to reverse the nodes in a linked list. The reverse function rearranges the nodes in the list so that their order is reversed. You should do this without creating or destroying nodes.
The function prototype: void reverse_list(Node*& head);
Write a function that returns the minimum data value in a linked list. Given a linked list A = (4, 5, 10, -1, 0), the function int Find_Max(Node * head) shall return -1.
Write a function to split a linked list into two linked list. Given lists A* = (4, 6, 3, 9), your function shall create new linked lists, A1* = (4, 6) and A2* = (3, 9), after that your function should delete the input linked list A. If the size of A is odd, then list A1* is greater than list A2* by one value. Print out A before splitting, A1, A2, and A after splitting. Your function prototype: void Split_List(Node*& head).
In: Computer Science
Consider a linked list whose nodes are objects of the class Node:
class Node {
public int data;
public Node next;
}
prev references a node n1 in the
list and curr references the node
n2 that is right after n1 in the
list. Which of the following statements is used to insert a new
node, referenced by newNodebetween
prev and curr?
Group of answer choices
newNode.next = curr;
prev.next = newNode;
newNode.next = head;
head = newNode;
prev.next = newNode;
newNode.next = prev;
prev.next = curr;
newNode.next = curr;
none of the above
Which of the following statements deletes the first node of a linked list implementation of ListInterface that has 10 nodes? Assume curr refers to the second node in the list and the head of the list is the reference variable fistNode
Group of answer choices
A. firstNode.next = curr.next;
B. firstNode = curr.next;
C. firstNode = firstNode.next;
D. curr = firstNode.next;
E. B and C
In LList2 implementation of the ListInterface,
Group of answer choices
A. The worst-case runtime of contains() is independent of the number of items in LinkedList
B. The runtime of getLength() is independent of the number of items in LinkedList
C. The runtime of remove(1) (removing the first element) is independent of the number of items in LinkedList
D. A and B
E. B and C
In a linked implementation of ListInterface, if the reference to the first node is null, this means
Group of answer choices
the list is full
the garbage collector should be invoked
we can't add items to the list
the list is in an unstable state
the list is empty
In: Computer Science