Posts by Danilo Marto • 11 points
2 posts
-
-1
votes3
answers110
viewsA: Bubble Sort algorithm error in Python
I did so def swap( array, i, j ): tmp = array[ i ] array[ i ] = array[ j ] array[ j ] = tmp def bubble( array ): for i in range( 0, len( array ) ): for j in range( len( array ), i + 1, -1 ): if…
-
1
votes3
answers138
viewsQ: The main function and its arguments. How does it manage to assign to its argc and *argv[] arguments the parameters passed via terminal?
For my question to be clearer. Suppose my program, called main, needs to receive any number of console parameters. To do so, I would have to do it. int main( int argc, char *argv[] ){ ... return 0;…