Preview

Assessment of Analysis and Design of Algorithms

Powerful Essays
Open Document
Open Document
4183 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Assessment of Analysis and Design of Algorithms
MC0080-Analysis and Design of Algorithms

Question 1- Describe the following: Well known Sorting Algorithms Divide and Conquer Techniques
Answer:
Well known Sorting Algorithms
We know the following well - known algorithms for sorting a given list of numbers:
Ordered set: Any set S with a relation, say, ≤ , is said to be ordered if for any two elements x and y of S, either x ≤ y or x ≥ y is true. Then, we may also say that (S, ≤) is an ordered set.
1. Insertion sort
The insertion sort, algorithm for sorting a list L of n numbers represented by an array A [ 1… n] proceeds by picking up the numbers in the array from left one by one and each newly picked up number is placed at its relative position, w.r.t. the sorting order, among the earlier ordered ones. The process is repeated till each element of the list is placed at its correct relative position.
2. Bubble sort
The Bubble Sort algorithm for sorting of n numbers, represented by an array A [1..n], proceeds by scanning the array from left to right. At each stage, compares adjacent pairs of numbers at positions A[i] and
A [i +1] and whenever a pair of adjacent numbers is found to be out of order, then the positions of the numbers are exchanged. The algorithm repeats the process for numbers at positions A [i+1] and A [i + 2]
3. Selection sort
Selection Sort for sorting a list L of n numbers, represented by an array
A [ 1.. n], proceeds by finding the maximum element of the array and placing it in the last position of the array representing the list. Then repeat the process on the sub array representing the sublist obtained from the list excluding the current maximum element.
4. Shell sort
The sorting algorithm is named so in honor of D.L Short (1959), who suggested the algorithm. Shell sort is also called diminishing -increment sort. The essential idea behind Shell Sort is to apply any of the other sorting algorithms (generally Insertion Sort) to each of the several interleaving sublists of

You May Also Find These Documents Helpful

  • Good Essays

    Nt1420 Unit 6

    • 1145 Words
    • 5 Pages

    INSTRUCTIONS: 1. THERE ARE SIX (6) QUESTIONS IN THIS PAPER. 2. ANSWER FIVE (5) QUESTIONS ONLY. Question 1 Arrays are used when storing a large number of values. You are required to create an array named a and answer the following questions regarding array manipulation. a. Write a method fillRandom(int[] a, int min, int max), fill the array a with a random integer value. (Note: Math.random() returns a double in the range of 0.0 and 1.0, therefore it is cast to an integer number, between the minimum and maximum value). [6 marks] b. Write the Bubble sort method to sort array a into descending order. [10 marks] c. In the quicksort, an algorithm an element is chosen from the unsorted list. This element is called the…

    • 1145 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture.…

    • 714 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Step 3: Complete the following pseudocode based on the algorithm and the variables you declared above.…

    • 777 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 4

    • 380 Words
    • 2 Pages

    The term ________sort_________ refers to the process of rearranging information in alphabetical, numerical, or chronological order.…

    • 380 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    ECET 370 Week 5 Lab 5

    • 650 Words
    • 3 Pages

    Exercise 1: Review of the Lecture Content Create a project using the ArrayList class and the Main class provided in DocSharing. The ArrayList class contains implementations of the first three search methods explained in this week's lecture: sequential, sorted, and binary search. The Main class uses these three methods. These programs test the code discussed in the lecture. Compile the project, run it, and review the code that is given carefully.…

    • 650 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Differences between numbers are ordered. The difference between any pair of numbers is greater than, less than, or equal to the difference between any other pair of numbers.…

    • 529 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    Searching and Sorting Streams and Files Graphics GUI Components and Events Mouse, Keyboard, Sounds, and Images Big-O Analysis of Algorithms The Java Collections Framework Lists and Iterators Stacks and Queues Recursion Revisited Binary Trees Lookup Tables and Hashing Heaps and Priority Queues Design Patterns…

    • 3908 Words
    • 16 Pages
    Powerful Essays
  • Satisfactory Essays

    LYT2 Task2

    • 4061 Words
    • 12 Pages

    Stein, S. S., Gerding, E. H., Rogers, A. C., Larson, K. K., & Jennings, N. R. (2011). Algorithms…

    • 4061 Words
    • 12 Pages
    Satisfactory Essays
  • Good Essays

    Rhetorical Modes Matrix

    • 649 Words
    • 3 Pages

    Spatial order is the best method. This method arranges ideas, according to physical characteristics or appearances.…

    • 649 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Info1105

    • 951 Words
    • 4 Pages

    Now if we traverse the list from head to tail, we always get a sorted list.…

    • 951 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    lolz

    • 480 Words
    • 4 Pages

    7. How do you sort first 15 lines in a file called 'datafile" ? (1)…

    • 480 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    carloe :)

    • 253 Words
    • 2 Pages

    Problem 1. a) Write an application that can hold five integers in an array. Display the integers from first to last, and then display the integers from last to first.…

    • 253 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    CS 220 – Programming w/ Data Structures: You have missed one assignment and one quiz. Your instructor has extended your assignment due date to this Sunday, April 10. Your instructor has also let you to take your Quiz # 2 during his office hours during this week. Let me know if you need additional support to study for this quiz. Your grade to date in this class is 30.2/37 81.62% B.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    (Programming Language 1) A high-level IBM programming language introduced in 1964 with the System/360 series, developed by George Radin of IBM in 1964. Originally named (NPL) and Fortran VI. It was designed to combine features of and eventually supplant COBOL and FORTRAN, which never happened. A PL/I program is made up of procedures (modules) that can be compiled independently. There is always a main procedure and zero or more additional ones. Functions, which pass arguments back and forth, are also provided.…

    • 590 Words
    • 3 Pages
    Good Essays
  • Better Essays

    3.4.1 Localization

    • 1753 Words
    • 8 Pages

    The algorithm operates on all black pixels P1 that can have eight neighbors. The neighbors are, in order, arranged as:…

    • 1753 Words
    • 8 Pages
    Better Essays