TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALEX WALKER
from: LEONID BUTENKO
date: 1997-12-02 21:47:00
subject: Sorting small arrays?

Hello Alex!
 (Wednesday 26-11-1997 at 01:12) Alex Walker wrote in message to All:
 AW>      I'm a student, learning C++ and as part of my homework I'm doing
 AW>      a small program that sorts a small array of data (only 8 elements).
 AW>      With an array of this size, does it really matter what sort
 AW>      algorithm I use?  Wouldn't the dreaded Bubble sort give similar
 AW>      performance to other algorithms, (evne if repeated 100 times)?
 AW>      So far I think I'll use the Selection Sort.  But if there is one
 AW>      algorithm that shines when used on small arrays, please let me 
ow.
I think, it isn't matter what kind of sorts you'll be using, absolute! 
Because, you have too little amount of elements. In your situation will be 
better to use that algorithm, which have the shorter code. (e.g. staight 
selection sort)
Leonid Butenko
--- GoldED/W32 3.00a4+
---------------
* Origin: This is invisible string. (FidoNet 2:5023/9.25)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.