View difference between Paste ID: 404y6qBc and Tws8u2YT
SHOW: | | - or go back to the newest paste.
1
    void radixSort(ArrayList<E> *lista, int base, int numMaxSize){
2
3
        lista->goToStart();
4
        LinkedList<E>  listBucket[base];
5
        for(int j = 0; j!=numMaxSize; j++)
6
        {
7
            while(lista->getSize()!=0)
8
            {
9
                int  tmpNum = int(lista->getElement()) /  pow(base,j) ;
10
                int tmpPos =  tmpNum % base;
11
                listBucket[tmpPos].append(lista->remove());
12
            }
13
            for(int i = 0; i!=base; i++)
14-
                while(listBucket[i].getSize()!=0)
14+
            { 
15-
                    lista->append(listBucket[i].remove());
15+
               while(listBucket[i].getSize()!=0)
16-
        }
16+
                { 
17-
        cout << "hola radix" << endl;
17+
                   lista->append(listBucket[i].remove());
18
                }        
19
            }  
20
        }  
21
    }