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 03:10
This program reads a file called 'test.txt'. you are required to write two functions that build a wordlist out of all of the words found in the file and print all of the unique words found in the file. remove punctuations using 'string.punctuation' and 'strip()' before adding words to the wordlist. write a function build_wordlist() that takes a 'file pointer' as an argument and reads the contents, builds the wordlist after removing punctuations, and then returns the wordlist. another function find_unique() will take this wordlist as a parameter and return another wordlist comprising of all unique words found in the wordlist. example: contents of 'test.txt': test file another line in the test file output: ['another', 'file', 'in', 'line', 'test', 'the']
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Which of these is a benefit of using objects in a powerpoint presentation? a. collaborators can create the external files while you create and edit the slide show. b. you can easily change the theme and design of the presentation. c. you can have older data in the source file while having up-to-date data in the presentation. d. collaborators can easily share the presentation.
Answers: 2
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
English, 25.01.2020 19:31
Questions on the website: 13722360