In: Statistics and Probability
Not Really an essay. Filtration is a relatively non-selective process. Make a list of the specific substances that pass through the filtration membrane. Make another list of the substances that do not. Are there any advantages for using a non-selective process in producing filtrate? Are there any disadvantages?
In: Anatomy and Physiology
Foundation of Computer Science
Describe an algorithm that takes as input a list of n integers and produces as output the largest difference obtained by subtracting an integer in the list from the one following it. Write its corresponding program using your favorite programming language
In: Computer Science
Thank You
In: Computer Science
Complete the required methods:
public class SongList
{
// instance variables
private Song m_last;
private int m_numElements;
// constructor
// Do not make any changes to this method!
public SongList()
{
m_last = null;
m_numElements = 0;
}
// check whether the list is empty
// Do not make any changes to this method!
boolean isEmpty()
{
if (m_last == null)
return true;
else
return false;
}
// return the size of the list (# of Song nodes)
// Do not make any changes to this method!
public int size()
{
return m_numElements;
}
// add a new Song to the circular linked list with the given
artist and
// title, keeping the list sorted by *song title*.
public void add(String artist, String title)
{
// TODO: implement this method
}
// remove a Song associated with the given artist and title from
the list,
// keeping the list sorted by *song title*.
public boolean remove(String artist, String title)
{
// TODO: implement this method
}
// build and return a circular linked list that contains all songs
from the
// given artist
public SongList buildList(String artist)
{
// TODO: implement this method
}
// return a string representation of the list
// Do not make any changes to this method!
public String toString()
{
String listContent = "";
Song current = m_last;
if (m_last != null)
do
{
current = current.getLink();
listContent += " [" + current.getArtist() + " - " +
current.getTitle() + "]\n";
} while (current != m_last);
return listContent;
}
}
// The Song class that represents a song
// Do not make any changes to this file!
public class Song
{
// instance variables
private String m_artist;
private String m_title;
private Song m_link;
// constructor
public Song(String artist, String title)
{
m_artist = artist;
m_title = title;
m_link = null;
}
// getters and setters
public void setArtist(String artist)
{
m_artist = artist;
}
public String getArtist()
{
return m_artist;
}
public void setTitle(String title)
{
m_title = title;
}
public String getTitle()
{
return m_title;
}
public void setLink(Song link)
{
m_link = link;
}
public Song getLink()
{
return m_link;
}
}
In: Computer Science
case study
1. Draw an Entity Relationship Diagram (ERD) for the following problem. Make sure you identify correct relationships, attributes, and identifiers (keys).
2. Implement the database design into tables using an industrial-strength database management system (e.g. Oracle SQL+).
case:
HELP is a voluntary organization that provides aid to people. Based on the following brief description of operations, create the appropriate fully labeled Crow’s Foot ERD.
Individuals volunteer their time to carry out the tasks of the organization. For each volunteer, their name, address, and telephone number are tracked. Each volunteer may be assigned to several tasks during the time that they are doing volunteer work, and some tasks require many volunteers. It is possible for a volunteer to be in the system without having been assigned a task yet. It is possible to have tasks that no one has been assigned. When a volunteer is assigned to a task, the system should track the start time and end time of that assignment.
For each task, there is a task code, task description, task type, and a task status. For example, there may be a task with task code “101,” description of “answer the telephone,” a type of “recurring,” and a status of “ongoing.” There could be another task with a code of “102,” description of “prepare 5000 packages of basic medical supplies,” a type of “packing,” and a status of “open.”
For all tasks of type “packing,” there is a packing list that specifies the contents of the packages. There are many different packing lists to produce different packages, such as basic medical packages, child care packages, food packages, etc. Each packing list has a packing list ID number, packing list name, and a packing list description, which describes the items that ideally go into making that type of package. Every packing task is associated with only one packing list. A packing list may not be associated with any tasks, or may be associated with many tasks. Tasks that are not packing tasks are not associated with any packing list.
In: Computer Science
// The Song class that represents a song
// Do not make any changes to this file!
public class Song
{
// instance variables
private String m_artist;
private String m_title;
private Song m_link;
// constructor
public Song(String artist, String title)
{
m_artist = artist;
m_title = title;
m_link = null;
}
// getters and setters
public void setArtist(String artist)
{
m_artist = artist;
}
public String getArtist()
{
return m_artist;
}
public void setTitle(String title)
{
m_title = title;
}
public String getTitle()
{
return m_title;
}
public void setLink(Song link)
{
m_link = link;
}
public Song getLink()
{
return m_link;
}
}
Complete the required methods:
public class SongList
{
// instance variables
private Song m_last;
private int m_numElements;
// constructor
// Do not make any changes to this method!
public SongList()
{
m_last = null;
m_numElements = 0;
}
// check whether the list is empty
// Do not make any changes to this method!
boolean isEmpty()
{
if (m_last == null)
return true;
else
return false;
}
// return the size of the list (# of Song nodes)
// Do not make any changes to this method!
public int size()
{
return m_numElements;
}
// add a new Song to the circular linked list with the given
artist and
// title, keeping the list sorted by *song title*.
public void add(String artist, String title)
{
// TODO: implement this method
}
// remove a Song associated with the given artist and title from
the list,
// keeping the list sorted by *song title*.
public boolean remove(String artist, String title)
{
// TODO: implement this method
}
// build and return a circular linked list that contains all songs
from the
// given artist
public SongList buildList(String artist)
{
// TODO: implement this method
}
// return a string representation of the list
// Do not make any changes to this method!
public String toString()
{
String listContent = "";
Song current = m_last;
if (m_last != null)
do
{
current = current.getLink();
listContent += " [" + current.getArtist() + " - " +
current.getTitle() + "]\n";
} while (current != m_last);
return listContent;
}
}
In: Computer Science
LINKLIST CLASS BELOW
/**
* Builds a singly linked list of size 5 and prints it to the
console.
*
* @author Jochen Lang
*/
class LinkList {
DNode llist;
LinkList( int sz ) {
if ( sz <= 0 ) {
llist = null;
}
else {
// start with list of size 1
llist = new DNode( "0", null, null );
DNode current = llist; // temp node for loop
// add further nodes
for ( int i=1; i //
create node and attach it to the list
DNode node2Add = new DNode(
Integer.toString(i), null, null );
current.setNext(node2Add); // add
first node
current=node2Add;
}
}
}
/**
* Print all the elements of the list assuming that they are
Strings
*/
public void print() {
/* Print the list */
DNode current = llist; // point to the first
node
while (current != null) {
System.out.print((String)current.getElement() + "
");
current = current.getNext(); // move to the next
}
System.out.println();
}
public void deleteFirst() {
if ( llist != null ) {
llist = llist.getNext();
}
}
public void deleteLast() {
}
// create and display a linked list
public static void main(String [] args){
/* Create the list */
LinkList llist = new LinkList( 5 );
/* Print the list */
llist.print();
/* delete first and print */
llist.deleteFirst();
llist.print();
/* delete last and print 5 times */
for ( int i=0; i< 5; ++i ) {
llist.deleteLast();
llist.print();
}
}
}
DNODE CLASS BELOW
public class DNode {
private Object element;
private Node next;
private Node prev;
Node() { this(null, null, null); }
Node(Object e, Node n, Node p) {
element = e;
next = n;
prev = p;
}
public void setElement(Object newElem) { element = newElem; }
public void setPrev(Node newPrev) { prev = newPrev; }
public void setNext(Node newNext) { next = newNext; }
public Object getElement() { return element; }
public Node getNext() { return next; }
public Node getPrev() { return prev; }
}In: Computer Science
Can anyone explain to me why I am getting an access violation when I try to add notes? It occurs when I try to set the "pLast" pointer to the previous node (for a doubly linked list). The code worked as singly linked list. When I added a "pLast" pointer and the needed code to make it a doubly linked list everything broke.
#include <iostream>
#include <stdlib.h>
using namespace std;
//build class that has a private function to inc count.
class LinkedListCount {
private:
struct CountNode {
int data;
int countVar; //Make the variable "countVar" private to protect integrity.
CountNode* pNext = NULL;
CountNode* pLast = NULL; //Needed for bubbling back through list.
};
//Keep track of head
CountNode* head;
CountNode* current;
CountNode* temp;
public:
//Constructor Function (Set default values for head, current, and temp)
LinkedListCount() {
head = NULL;
current = NULL;
temp = NULL;
}
void AddNode(int dataIn) { //Addnode Function
//Create and populate list.
CountNode* newNode = new CountNode;
newNode->pNext = NULL;
newNode->pLast = NULL;
newNode->data = dataIn;
temp = head;
newNode->countVar = 0;
if (temp != NULL) { //We already have data entery.
if (temp->pNext == NULL) {
newNode = temp->pNext;
newNode->pLast = head; //****THIS IS WHERE ACCESS VIOLATION OCCURES
}
//Set variables with the understanding that the head is the only data point.
else {
current = temp->pNext; //Set it equal to head.
}
while (current->pNext != NULL) {//This could be eliminated with keeping track of a tail.
current = current->pNext; //Attach this to the end of the list.
}
current->pNext = newNode; //And newMode->pNext = to Null so next time I add data I'll get to the end of the list.
newNode->pLast = current;
}
else if (head == NULL) {
head = newNode;
}
}
};
void addNodes(LinkedListCount &DataList) { //Populates list.
for (int i = 0; i < 20; i++) {
DataList.AddNode(i);
}
}
int main(void)
{
addNodes(DataList);
}In: Computer Science
In: Statistics and Probability