jackfrued / jackfrued/Python-100-Days
Day16-20选择排序bug优化
Open
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Description
问题描述:
list的比较和排序是按照asc码的顺序来的,如果有一个list = ['3', '7', '10', '1', '9', '2', '111'],按照现在的算法排序结果为:result = ['1', '10', '1111', '2', '3', '7', '9']
优化:
比较部分指定类型为int或float
if comp(int(items[j]), int(items[min_index])):
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Day16-20 selection-sort example and inspect the comparison used when finding the minimum item. Reproduce the issue with the sample list, then verify that numeric values sort in numeric order and that the example still runs correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100