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 function that computes the commission

Write a function that computes the commission. The header is: def compute Commission salesAmount: The commission rate is 0.09.

  Write a program that computes the circumference of a circle

Write a program that computes the circumference of a circle with a radius of 7.5 and prints out the result. The circumference is 2* pi * radius.

  Program that creates a dictionary containing

Write a program that creates a dictionary containing the U.S. states as keys and their capitals as values. The program should then randomly quiz the user by displaying

  Apply struct for reading packet data

Topic: Python 3 - PCAP file analysis - Apply struct for reading packet's data, extract and hash the ICMP data portion of the packet

  What do we do to keep the compiler from confusing a float

What is the shortest form of sum = sum + 1; or sum += 1; where 1 is always the increment value? What do we do to keep the compiler from confusing a float.

  Implement the insertion sort algorithm in python

Implement the insertion sort algorithm in python - Compare the time for these implementations for the following cases. The code for recording the runtime

  Need to to print out these columns

Need to to print out these 4 columns and filter them. Look at the first row of DESCR, you can see that the name of the road is CLEAR MOUNTAIN ROAD

  Ask the user for a length and a width of a rectangle

Asks the user for a length and a width of a rectangle. Each or all input will happen in a function and will then be returned from a function.

  Record a function that accepts as a parameter a string

In Python, record a function that accepts as a parameter a string of seven 0s and 1s. and returns an eight digit string in odd parity.

  Write python program that computes factorial of an integer

Write a Python program that computes the factorial of an integer X (the program should ask the user to enter the value of X). Write a Python program to compute.

  Define your except blocks before the try block

What keyword do we use to specify a block of code that will handle an exception? Define your except blocks before the try block.

  Write a program that reads the earthquake

Write a program that reads the earthquake data.txt, and to process the earthquake data file and create lists of earthquake magnitudes and their dates.

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