Skip to content

Misformatted/linked wiki entry in python sorting #11225

Open
@MarlieChiller

Description

@MarlieChiller

What would you like to share?

This file should be edited (I tried, but I dont think you can edit wikis on forks)


current

image

proposed

image

and requires modifying the markdown to this:

<h2>Selection sort</h2>

**selection sort**, algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from the unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array.
<ol>
<li> The subarray which is already sorted.</li>
<li> Remaining subarray which is unsorted.</li>

In every iteration of selection sort, the minimum element (considering ascending order) from the unsorted subarray is picked and moved to the sorted subarray.

#### Properties:
- Worst-case performance O(n^2)
- Best-case performance O(n)
- Average case performance O(n^2)

**read more at: [Wikipedia](https://en.wikipedia.org/wiki/Selection_sort)**<br>
**code: [Selection sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/selection_sort.py)**

***

Note: edit required to bold text and link to code. example ref

Additional information

No response

Activity

linked a pull request that will close this issue on Jan 2, 2024
deleted a comment from Khany123 on Jan 15, 2024
27371123

27371123 commented on Dec 3, 2024

@27371123

11:41:59
Here are some common issues related to misformatted or linked wiki entries in the context of Python sorting and how to address them:

Misformatted Entries

Incorrect Syntax Highlighting

  • Problem: In a wiki entry about Python sorting (like on a community wiki or a personal project's documentation wiki), if the code examples for sorting algorithms (such as the built-in  sorted()  function or the  list.sort()  method in Python) aren't properly formatted with the correct syntax highlighting, it can be confusing for readers. For example, code might be shown as plain text without the appropriate Python code formatting tags, making it hard to distinguish between keywords, variables, and function calls.
  • Solution: Use proper markdown or the specific formatting syntax supported by the wiki platform to mark code as Python code. For example, in many markdown-based wikis, you can enclose Python code within triple backticks like this:

11:42:00
This way, the wiki will usually render it with proper syntax highlighting, making it clear to readers.

Incomplete or Unclear Explanations

  • Problem: The wiki entry might describe Python sorting concepts but leave out important details. For example, when explaining the key parameter in the  sorted()  function (which allows you to specify a function to extract a comparison key from each element in a sequence), it might just mention it briefly without showing practical examples of how to use it for different data types like tuples or custom objects. So readers might not fully understand how to apply it in real scenarios.
  • Solution: Expand the explanations with more detailed examples. For the key parameter, you could show something like this:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triageAwaiting triage from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @MarlieChiller@27371123

      Issue actions

        Misformatted/linked wiki entry in python sorting · Issue #11225 · TheAlgorithms/Python