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

    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 1: Examine the following algorithm as a base for how the program should flow. (Reference: Designing a Program, page 31).…

    • 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 3: Searching Applications Select one of the following two problems to solve: Problem 1: Design and implement an algorithm that determines whether or not a given array of elements, listl, is completely contained within another given array of elements, Iist2. Consider two different scenarios: 1) both arrays are sorted; 2) both arrays are unsorted. Problem 2: Design an algorithm that when given a collection of integers in an unsorted array, determines the second smallest number (or second minimum). For example, if the array consists of the values 12, 23, 9, 17, 3, the algorithm should report the value 9, since it is the second smallest number in the array. Write a function that...…

    • 650 Words
    • 3 Pages
    Good 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
  • 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
  • Powerful Essays

    It 210

    • 2960 Words
    • 12 Pages

    After reading this chapter, you will be able to do the following: Declare and use one-dimensional arrays [Section 6.1] Manipulate parallel arrays [Section 6.1] Use the serial search technique to search an array for a specified element [Section 6.2] Use the bubble sort technique to sort an array into a specified order [Section 6.2] Use the binary search procedure for locating an item in an array [Section 6.3] Use the selection sort procedure for sorting an array [Section 6.3] Represent character strings as arrays [Section 6.4] Declare and use two-dimensional arrays [Section 6.5]…

    • 2960 Words
    • 12 Pages
    Powerful 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
  • Good Essays

    Programming Homework

    • 366 Words
    • 2 Pages

    The formula that will be used in this program is num_1 * num_2 adding 1 each repetition using num_2 = num_2 +1…

    • 366 Words
    • 2 Pages
    Good 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
  • Good Essays

    3) A description of at least two methods of sorting records and the benefits of each:…

    • 1173 Words
    • 6 Pages
    Good 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