Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm, which is a comparison sort, is named for the way smaller elements "bubble" to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems even when compared to insertion sort. Source from wikipedia
1 . Passing an untrusted parameter is a way to fail. It is often not a trivial task to make sure that a parameter is fully trusted. 2 . Using eval() makes code clever, therefore more difficult to follow. T
The main problem with actual use of eval() is only one:
Follow this rules if you are using eval():
1. Sometimes eval is the only/the right solution. 2. or most cases one should try something else. 3. If unsure, goto 2. 4. Else, be very, very careful.