subject

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()

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Who is the first president to use social media as part of his campaign strategy
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Will this setup result in what kathy wants to print?
Answers: 2
question
Computers and Technology, 24.06.2019 08:20
Which type of entity describes a fundamental business aspect of a database? a. linking b. lookup c. domain d. weak
Answers: 3
question
Computers and Technology, 24.06.2019 16:00
5.a fishing rod is formed from a composite material of 0.5 kg of glass fibers embedded in a matrix of 0.5 kg of epoxy resin. the glass fibers are assumed to be long, continuous and unidirectional. to achieve a greater stiffness it is proposed to use a different composite that is comprised of long continuous carbon fibers that will be embedded in a matrix of 0.5 kg of epoxy resin. if the modulus of elasticity of the carbon fiber composite is 10% greater than the elastic modulus of the glass fiber composite, estimate the mass of carbon fibers that will be used to make the carbon fiber composite. assume the applied tensile stress is parallel to the direction of the long axis of the fibers. the epoxy resin, glass fiber, and carbon fiber have an elastic modulus of 5, 86, and 350 gpa respectively and a density of 1100, 2500, and 1800 respectively.
Answers: 3
You know the right answer?
List class that we developed and test them. The following is the outline of the code that you will b...
Questions
question
Computers and Technology, 14.01.2021 23:50
question
Biology, 14.01.2021 23:50
question
English, 14.01.2021 23:50
question
Mathematics, 14.01.2021 23:50
question
Mathematics, 14.01.2021 23:50
question
Chemistry, 14.01.2021 23:50