There are two calsses: node.py and a5.py. The a5.py contains three important methods:
The task is to fill in these methods given in the a5.py. Hints are given to you inside the a5.py class so make sure to check them out. Note that one of the important concepts in this example is that when a new element is inserted into the list, it gets inserted into it’s appropriate (sorted) position. Please take a look at the examples to see how random values are inputted and the result is sorted.
Please enter a word (or just hit enter to end): bottle
Please enter a word (or just hit enter to end): a
Please enter a word (or just hit enter to end): water Please enter a word (or just hit enter to end): of Please enter a word (or just hit enter to end):
The structure contains 4 items: a bottle of water
Please enter a word (or just hit enter to end): Ana
Please enter a word (or just hit enter to end): Bill
Please enter a word (or just hit enter to end): car
Please enter a word (or just hit enter to end): algorithm Please enter a word (or just hit enter to end): button Please enter a word (or just hit enter to end):
The structure contains 5 items: algorithm Ana Bill button car
NODE.PY
"""File: node.py
Node classes for one-way linked structures and two-way
linked structures."""
class Node(object):
def __init__(self, data, next = None):
"""Instantiates a Node with default next of None"""
self.data = data
self.next = next
A5.PY
"""
File: a5.py
Define a length function.
Define a printStructure function.
Define an insert function.
Test the above functions and the Node class.
"""
from node import Node
def length(head):
"""Returns the number of items in the linked
structure
referred to by head."""
probe = head
count = 0
# ADD CODE HERE: Count the number of nodes in
the structure
return count
def insert(newItem, head):
"""Inserts newItem at the correct position
(ascending order) in
the linked structure referred to by head.
Returns a reference to the new
structure."""
# if head == None:
# if structure is
empty
# ADD CODE
HERE
# else:
#Insert newItem in its
place (ascending order)
# ADD CODE HERE
return head
def printStructure(head):
"""Prints the items in the structure referred to
by head."""
# ADD CODE HERE
def main():
"""Gets words from the user and inserts in
the
structure referred to by head."""
head = None
userInput = input('Please enter a word (or just
hit enter to end): ')
while userInput != '':
head = insert(userInput,
head)
userInput =
input('Please enter a word (or just hit enter to end): ')
print('The structure contains', length(head),
'items:')
printStructure(head)
if __name__ == "__main__": main()
In: Computer Science
Recommend how projected financial statements and other measures of business performance could be used by a manufacturing company to evaluate its activities and processes. (minimum word count 700 words )
Take note of word count
In: Finance
In: Economics
Write code in Python that does the following : An anagram is
when the order of a word can be changed to create a new word
(evil,
live, and vile for example). Using the dictionary provided, find
all of the anagram groups.
Which words contain the most anagrams? How large is this group?
Here is another example:
Alert, alter, and later have 3 in their group. Use the provided
dict.txt as your word list,
solution must also finish in less than a minute.
* I know there is no dict.txt file to use here..
file = open("dict.txt", "r", encoding="utf8")
*looking for a way to sort through the file and group anograms together
*output the groups from largest to smallest (if there is only a
single word in a group, no need to display)
file.close()
In: Computer Science
Python 1.)Assume that name is a variable of type String that has been assigned a value. Write an expression whose value is the last character of the value of name. So if the value of name were "Blair" the expression's value would be 'r'. 2.)Assume that word is a variable of type String that has been assigned a value. Write an expression whose value is a String consisting of the last three characters of the value of word. So if the value of word were "biggest" the expression's value would be "est".
In: Computer Science
Python
This part involves creating a function that will manage a List of unique strings. The function is passed a string and a list as arguments. It passes a list back.
The function to add a word to a List if word does not exist in the List. If the word does exist in the List, the function does nothing.
Create a test program that takes a string as input and then calls the function over and over until the user enters "Done." If the string "Done" is entered, the program sorts the list and prints it out line by line.
In: Computer Science
An experiment consists of randomly rearranging the 10 letters of
the word QUARANTINE
into a sequence of 10 letters, where all possible orders of these
10 letters are equally likely. Find the probability of each of the
following events:
(1) the first three letters include no A’s;
(2) the first three letters or the last three letters (or both) include no A’s;
(3) the fourth letter is the first A;
(4) the first letter and the last letter are the same;
(5) the word ‘QUARANTINE’ is obtained;
(6) the sequence contains the word ‘RAN’.
In: Statistics and Probability
Translate the following medical terms based on your knowledge of suffixes, prefixes (if present) and combining forms. Please do not give me the dictionary definition meaning only include the word parts that are present in the term. So first identify the word parts present and then translate only using those word parts
Colectomy
Colonoscopy
Dentalgia
Gastroenteritis
Gastrojejunostomy
Gingivectomy
Glossopharyngeal
Glycolysis
Hepatomegaly
Cholecystojejunostomy
Sublingual
Lipase
Cholecystolithiasis
Periodontal
Palatoplasty
Sialadenectomy
Steatorrhea
Hematochezia
Hyperbilirubinemia
In: Anatomy and Physiology
What is the value stored in variable perimeter after the code has been executed? (6 pts)
.data
length: .word 16
width: .word 24
perimeter: .word 0
.text
la $s0, length
la $s1, width
la $s2, perimeter
lw $s3,0($s0)
lw $s4, 0($s1)
add $s3, $s3, $s3
add $s4, $s3, $s4
add $s5, $s3, $s4
sw $s5, 0($s2)
Perimeter:__________________________________________
In: Computer Science
250 word minimum; no maximum word count. Display the word count at the end of your post.
In: Nursing