What sorting algorithm did you use

Assignment Help Python Programming
Reference no: EM132881703

TM111 Introduction to computing and information technology - Arab Open University

Question 1:
You are requested to write a program according to the following specification:
1. Create a list that contains minimum 12 characters
2. Initialize the list with random characters from alphabetical characters.
3. Sort the characters in the list as follows:
a. find the smallest character in the list and then move it to the first position.
b. Keep doing step a for all characters by finding the smallest character and moving it to the second position and so on till all the characters in the list are sorted.
To answer question 1, you need to do the following:
1. Write an algorithm for the sorting process you will follow as described in steps a and b above.
2. What sorting algorithm did you use?
3. Implement the algorithm using OUBuild script following the above steps.
4. Provide 3 screenshots, one for the code, one for the initial list before sorting, and one for the list after the sorting is done.

Question 2:
Consider a list of unsorted numbers, think about an algorithm to test all the items in the list to check whether there are any two consecutive numbers (even if they are not adjacent) or not.
• For example 1: List A = [10,7,23,18,45, 24] -> output: true
o the output is True because 23 and 24 are consecutive numbers (even not adjacent).
• For example 2: List B = [24,15,18,18,42, 22] -> output: false
o the output of example 2 is False because there isn't any consecutive numbers.
Now, answer the following Questions:
1- Write an algorithm to solve the above problem?
2- Can you write a new algorithm that is more efficient than the one you wrote in question1 which does the same job? if the answer is yes you need to write down the new algorithm, if not you need to mention that your solution is the best solution?

Attachment:- Information technology.rar

Reference no: EM132881703

Questions Cloud

Description of the impact of ms in psychology program : Description of the impact of your MS in Psychology program as it relates to your personal and professional growth. How will you apply your knowledge
Determine the probable income or loss from operations : A unit variable cost of $40, and fixed costs of $400,000. Determine the probable income (loss) from operations if sales total 16,000 units
Perform literary search to learn about parts of diagnostic : Prepare a one-page information pamphlet (brochure) on the parts of the DSM-5, where they identify and describe what they consist of.
How does learned knowledge or behavior potentially affect : How does your learned knowledge or behavior potentially affect your developed schemata? What if you learned that this knowledge or behavior was not accurate?
What sorting algorithm did you use : Write an algorithm for the sorting process you will follow as described in steps a and b above and What sorting algorithm did you use
Evaluate the applicability of sct to a real-life experience : Is there something you know about or a behavior that you display that was learned from your social environment? Were you modeled this behavior?
Reconcile the variable costing income from operations : Reconcile the variable costing income from operations of $38,500 with the absorption costing income from operations determined in (a)
Describe stability and controllability : Describe stability and controllability and how they affect performance attributions. Include why these matter in the context of learning.
Identify the relevant research on each side of controversy : Evaluate and reflect on the findings. Identify a personal, educated stance on the topic, and then support it with relevant research.

Reviews

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