Besonderhede van voorbeeld: -8866468863693470826

Metadata

Data

English[en]
In computer science, selection sort is an in-place comparison sorting algorithm. It has an O("n") time complexity, which makes it inefficient on large lists, and generally performs worse than the similar insertion sort. Selection sort is noted for its simplicity and has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.
Thai[th]
การเรียงลําดับแบบเลือก () เป็นขั้นตอนวิธีการเรียงลําดับอย่างง่ายโดยใช้วิธีการเปรียบเทียบ ทํางานโดยการหาค่าเหมาะสมที่สุด (ค่ามากสุดหรือน้อยสุด) ที่อยู่ในรายการส่วนที่ยังไม่เรียงและนําค่าเหมาะที่สุดนั้นมาต่อท้ายของส่วนที่เรียงแล้ว ก็จะทําให้ส่วนที่เรียงแล้วมีขนาดใหญ่ขึ้นทีละหนึ่งในแต่ละรอบการทํางาน ทําเช่นนี้จนไม่มีส่วนที่ยังไม่เรียงก็เสร็จ แต่ด้วยประสิทธิภาพเมื่อเกิดกรณีทั่วไปที่ O(n) ทําให้ไม่เหมาะที่จะใช้ในกรณีที่มีข้อมูลในรายการเป็นจํานวนมาก

History

Your action: