Re:How can a computer deal a poker hand?
by mattb314 on Friday September 30, 2016 @11:53PM
(#12616440)
It looks correct to me, but keep in mind that deleting elements from the middle of an array is O(n), so overall your algorithm is O(n^2). You could fix this by always swapping your chosen element with the last element of the sorted_deck before removing it because removing from the end of an array is O(1).
[ Parent
| on HN ]
There are no comments on this comment yet.