Computers and Technology

List class that we developed and test them. The following is the outline of the code that you will be submitting. For the time being assume that the data that you are handling are integers. Later on when you use objects of other classes you will write compare functions for those classes and you can use your LinkedList class as is. class Link (object): ...
class LinkedList (object):
# get number of links
def get_num_links (self):
# add an item at the beginning of the list
def insert_first (self, data):
# add an item at the end of a list
def insert_last (self, data):
# add an item in an ordered list in ascending order
def insert_in_order (self, data):
# search in an unordered list, return None if not found
def find_unordered (self, data):
# Search in an ordered list, return None if not found
def find_ordered (self, data):
# Delete and return Link from an unordered list or None if not found
def delete_link (self, data):
# String representation of data 10 items to a line, 2 spaces between data
def __str__ (self):
# Copy the contents of a list and return new list
def copy_list (self):
# Reverse the contents of a list and return new list
def reverse_list (self):
# Sort the contents of a list in ascending order and return new list
def sort_list (self):
# Return True if a list is sorted in ascending order or False otherwise
def is_sorted (self):
# Return True if a list is empty or False otherwise
def is_empty (self):
# Merge two sorted lists and return new list in ascending order
def merge_list (self, other):
# Test if two lists are equal, item by item and return True
def is_equal (self, other):
# Return a new list, keeping only the first occurence of an element
# and removing all duplicates. Do not change the order of the elements.
def remove_duplicates (self):
def main():
# Test methods insert_first() and __str__() by adding more than
# 10 items to a list and printing it.
# Test method insert_last()
# Test method insert_in_order()
# Test method get_num_links()
# Test method find_unordered()
# Consider two cases - data is there, data is not there
# Test method find_ordered()
# Consider two cases - data is there, data is not there
# Test method delete_link()
# Consider two cases - data is there, data is not there
# Test method copy_list()
# Test method reverse_list()
# Test method sort_list()
# Test method is_sorted()
# Consider two cases - list is sorted, list is not sorted
# Test method is_empty()
# Test method merge_list()
# Test method is_equal()
# Consider two cases - lists are equal, lists are not equal
# Test remove_duplicates()
if __name__ == "__main__":
main()

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:50, OnlyaBurden
In this lab, you complete a prewritten c++ program for a carpenter who creates personalized house signs. the program is supposed to compute the price of any sign a customer orders, based on the following facts: the charge for all signs is a minimum of $35.00. the first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. if the sign is made of oak, add $20.00. no charge is added for pine. black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. instructions ensure the file named housesign. cppis open in the code editor. you need to declare variables for the following, and initialize them where specified: a variable for the cost of the sign initialized to 0.00 (charge). a variable for the number of characters initialized to 8 (numchars). a variable for the color of the characters initialized to "gold" (color). a variable for the wood type initialized to "oak" (woodtype). write the rest of the program using assignment statements and ifstatements as appropriate. the output statements are written for you. execute the program by clicking the run button. your output should be: the charge for this sign is $82. this is the code, // housesign. cpp - this program calculates prices for custom made signs. #include #include using namespace std; int main() { // this is the work done in the housekeeping() function // declare and initialize variables here // charge for this sign // color of characters in sign // number of characters in sign // type of wood // this is the work done in the detailloop() function // write assignment and if statements here // this is the work done in the endofjob() function // output charge for this sign cout < < "the charge for this sign is $" < < charge < < endl; return(0); }
Answers: 1
image
Computers and Technology, 22.06.2019 11:40, malibu777
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
image
Computers and Technology, 22.06.2019 19:20, manny2085
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
image
Computers and Technology, 22.06.2019 21:30, Nathaliasmiles
The graph shows median weekly earnings for full-time workers according to education level. which can you not conclude?
Answers: 2
Do you know the correct answer?
List class that we developed and test them. The following is the outline of the code that you will b...

Questions in other subjects:

Konu
Mathematics, 24.02.2021 19:10
Konu
Mathematics, 24.02.2021 19:10
Konu
Mathematics, 24.02.2021 19:10