Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following set of questions will test your problem solving abilities. For each question, work some examples, write your algorithm in psuedocode (a simplified Python

The following set of questions will test your problem solving abilities. For each question, work some examples, write your algorithm in psuedocode (a simplified Python - it isnt anything official, just write sentences instead of code), then finally write your implementation (there is no need to write an entire program, each question is accompanied with predefined variables containing input). Lastly, try and optimize your solution. How many times are you iterating over structures? Is there some strategy you can deploy that would speed up to your code? Describe your code and why your solution solves the problem. Use only the Python structures discussed in class, on slides, or on homework.

1. Generate all permutations of a given string. Example: for string abc , generate the list [abc, acb, bac, bca, cab, cba] . Assumea a variable my_string exists and contains the string to permute. Assign your result to a variable result.

2. Given two strings, determine if they are anagrams of each other. Ignore spaces, punctuation, and capitalization. Assume the existence of two variables string1 and string2 holding the input strings. Assign your result to a variable result.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

The models used to analyse different national cultures.

Answered: 1 week ago

Question

The nature of the issues associated with expatriate employment.

Answered: 1 week ago