Examine both function implementations

Assignment Help Python Programming
Reference no: EM132138467

Lab Assignment -

Background - We have discussed, in detail, the function of Stacks and Queues and how they are specifically implemented in Python. To get a better understanding of the utility of these data structures, we will be creating functions which use the data structures and comparing the functionality of each.

The central C has been bolded and turned red to give you a point to focus on.

1. Download the files array_stack.py, exceptions.py, and palindrome.py. from this Moodle page. Use (and do not alter) the ArrayStack object in array_stack.py to implement the is_palindrome_stack function declared in palindrome.py. As mentioned in the associated comment, this function should take a string and use an ArrayStack in a non-trivial way in order to determine if the string, without spaces, without punctuation, and with normalized capitalization, is a palindrome. It should return True if it is a palindrome and False if it is not.

2. Download the file array_queue.py from this Moodle page. Use (and do not alter) the ArrayQueue object in array_queue.py to implement the is_palindrome_queue function declared in palindrome.py. As mentioned in the associated comment, this function should take a string and use an ArrayQueue in a non-trivial way in order to determine if the string, without spaces, without punctuation, and with normalized capitalization, is a palindrome. It should return True if it is a palindrome and False if it is not.

3. Examine both function implementations. Which of these functions is more efficient and why? (Note: You may use Big-O notation as part of your evidence but, even if you determine that they have the same Big-O functionality, you should be able to determine which of the two functions is nominally more efficient.)

4. Download the file postfix.py from this Moodle page. Use (and do not alter) the ArrayStack object in array_stack.py to implement the postfix_calculator function declared in postfix.py. As mentioned in the associated comment, this function should take a string and use an ArrayStack to implement the postfix notation algorithm implemented above. If your implementation encounters any problems during execution, it should throw the RPNError declared and defined in postfix.py.

Lab Requirements -

Download and alter palindrome.py and postfix.py as described above. You may add any additional helper methods as needed. Helper functions should be named with an underscore at the front as they are not designed to be publicly accessible If you add a helper function, be sure to comment it in the same style as the other, included functions.

Additionally, the "testing structure" of if __name__ == '__main__' has been included at the bottom of each file. You should use that section for your test code. I may look at it for understanding of how you are approaching testing but you will not be explicitly graded on code included there.

Attachment:- Assignment Files.rar

Reference no: EM132138467

Questions Cloud

Identify the underlying theoretical framework used : Review the Leuschner article, which is a meta study of research on the relationship of supply chain integration and firm performance.
Evaluate the supply chains overall performance : Evaluate the effectiveness of the supply chain's techniques, including process management, inventory management, capacity planning, and constraint management.
About the economic life of homeless man : Use the two big questions of economics and the economic way of thinking to answer the following questions about the economic life of a homeless man.
How the treatment plan needs to be adjusted : In Topic 5, you submitted a treatment plan for your client Eliza. Since the initial treatment plan, several changes have taken place within Eliza's case.
Examine both function implementations : CISC 160 Lab Assignment - Examine both function implementations. Which of these functions is more efficient and why
Under what condition is it ethically defensible to outsource : Under what conditions is it ethically defensible to outsource production to companies in the developing world that have much lower labor costs.
Number of acquisitions to help achieve its ambitions : Amazon.com made a number of acquisitions to help achieve its ambitions.
Think of your own upbringing and experiences : What major cultural differences would you need to be aware of when working with individuals from this country?
Research the specific personality disorder : Research the specific personality disorder from your chosen case study. Create a 10-15-slide PowerPoint presentation about your selected case study.

Reviews

len2138467

10/11/2018 10:17:17 PM

Lab Requirements - Download and alter palindrome.py and postfix.py as described above. You may add any additional helper methods as needed. Helper functions should be named with an underscore at the front as they are not designed to be publicly accessible. If you add a helper function, be sure to comment it in the same style as the other, included functions. Remember: These requirements may not be all encompassing. Use your brain, your knowledge of the system, and any descriptions within the code as sanity checks and reminders to make a complete system.

len2138467

10/11/2018 10:17:08 PM

Submission: Submit your altered palindrome.py and postfix.py and a copy of this file to the Moodle page. Be sure to alter the title page on the lab booklet and the header comments of the Python files to include your name, student number, and course section number. Submissions must be submitted in unzipped .py and .docx files. FAILURE TO SUBMIT UNZIPPED WILL CONSTITUTE FAILURE TO SUBMIT.

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd