How can an algorithm determine if a list is sorted?

  • Context: MHB 
  • Thread starter Thread starter Joystar77
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary

Discussion Overview

The discussion revolves around how an algorithm can determine if a list is sorted, specifically focusing on the mechanics of sorting algorithms like Bubble Sort and the definitions of arrays in the context of sorting.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant suggests that an algorithm needs one complete pass without any swaps to determine if the list is sorted.
  • Another participant questions which specific algorithm and array are being referenced, indicating that context is important for the discussion.
  • A participant describes the Bubble Sort algorithm using a specific example of an unsorted list and discusses the concept of arrays, seeking clarification on the definition of an array.
  • There is a clarification that the original statement about the array being sorted should specify which array is being referred to, emphasizing the need for precision in language.
  • A participant expresses gratitude for assistance in understanding the terminology used in mathematics courses, indicating a learning process regarding the concepts discussed.

Areas of Agreement / Disagreement

Participants express differing views on the definitions and specifics of the algorithm and array in question. There is no consensus on the definitions or the mechanics of how sorting is determined.

Contextual Notes

There are unresolved questions regarding the definitions of arrays and the specifics of the sorting algorithm being discussed. The discussion includes varying interpretations and lacks a unified understanding of the terms used.

Who May Find This Useful

Individuals interested in algorithms, sorting methods, and mathematical definitions may find this discussion relevant.

Joystar77
Messages
122
Reaction score
0
The question is as follows: "How does the algorithm know when the list is sorted?"

Is this the correct answer to this question: The array is already sorted, but an algorithm does not know if it is completed. The algorithm need one whole pass without any swap to know it is sorted.
 
Technology news on Phys.org
Joystar1977 said:
The question is as follows: "How does the algorithm know when the list is sorted?"
Which algorithm and array do you have in mind?
 
I thought of the algorithm as follows:

Bubble Sorting the list of numbers: 7, 12, 5, 22, 13, 32

7, 12, 5, 22, 13, 32
12, 7, 5, 22, 13, 32
12, 5, 7, 22, 13, 32
5, 12, 7, 22, 13, 32
5, 7, 12, 22, 13, 32

In math, an array refers to a set of numbers or objects that will follow a specific pattern. An array is an orderly arrangement, often in rows, columns or a matrix. Arrays are used in multiplication and division as it shows a great visual to show how multiplication can be shown as repeated addition and division can be shown as fair shares.
There are many authentic examples of arrays that help with the understanding of how using arrays can help students to see efficient strategies. Is this true about what an array means? There are no definitions in my textbook or examples given about what an array really is. Please let me know if this is correct.
 
I wasn't asking for the definition of an array in general. Since you used "the list" and "the algorithm" in the OP, I was wondering what those specific things are. So, the array is (7, 12, 5, 22, 13, 32) and the algorithm is Bubble sort.

The array is already sorted, but an algorithm does not know if it is completed. The algorithm need one whole pass without any swap to know it is sorted.
I would not say, "The array is already sorted" without specifying which array. You could say, "During the last pass, the array is already sorted, but an algorithm does not know it. The algorithm needs one whole pass without any swap to know the array is sorted". I agree with this statement.
 
Thank you Evgeny. Makarov! I am getting used to brand new terms, because I notice in different mathematics courses such as prealgebra, beginning algebra, and intermediate algebra there are other mathematical terms used. Again, thanks for helping me with this and thoroughly explaining the material. I truly and really appreciate it.
Joystar1977
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
Replies
9
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 133 ·
5
Replies
133
Views
11K