randomized_quicksort
this code does not show me any output

    #include <cstdlib>
    #include <iostream>
    using namespace std;
    int partition(int a[],int left,int right){
    	int i=left;
    	int j=right;
    	int temp;
    		int pivot=a[left];
    	while(i<=j){
    		while(a[i]<pivot)
    			 i++;
    		while( a[j]>pivot)
    			j--;
    		   if(i>j) break;
    		    if (i<j){
           temp=a[i];
    	   a[i]=a[j];
    	   a[j]=temp;
    	  
    	   i++;
    j--;
    
    			}
    
    
    
    
    	}
    
        
    
    	return i;
    
    
    }
    int randomized_partition(int a[],int left,int right){
    	int t=left+rand()%(right-left+1);
    	std::swap(a[right],a[t]);
    	return partition(a,left,right);
    
    
    
    }
     void randomized_quicksort(int a[],int l,int r){
    	 
    	   if(l>=r)  return ;
    	     int  q=randomized_partition(a,l,r);
    		  randomized_quicksort(a,l,q-1);
    		 randomized_quicksort(a,q+1,r);
    
    
    		 
    
      }
    int main(){
    	int a[]={12,6,4,7,9,10,11,14,13,19,18,21,20};
    int n=sizeof(a)/sizeof(n);
    randomized_quicksort(a,0,n-1);
     for (int i=0;i<n;i++){
    	 cout<<a[i]<<"  "<<endl;
     }
    
     
    return 0;
    }
it is randomized_quicksort    from introduction in algorithms third edition and   please help 
randomized_quicksort
===

this code does not show me any output

    #include <cstdlib>
    #include <iostream>
    using namespace std;
    int partition(int a[],int left,int right){
    	int i=left;
    	int j=right;
    	int temp;
    		int pivot=a[left];
    	while(i<=j){
    		while(a[i]<pivot)
    			 i++;
    		while( a[j]>pivot)
    			j--;
    		   if(i>j) break;
    		    if (i<j){
           temp=a[i];
    	   a[i]=a[j];
    	   a[j]=temp;
    	  
    	   i++;
    j--;
    
    			}
    
    
    
    
    	}
    
        
    
    	return i;
    
    
    }
    int randomized_partition(int a[],int left,int right){
    	int t=left+rand()%(right-left+1);
    	std::swap(a[right],a[t]);
    	return partition(a,left,right);
    
    
    
    }
     void randomized_quicksort(int a[],int l,int r){
    	 
    	   if(l>=r)  return ;
    	     int  q=randomized_partition(a,l,r);
    		  randomized_quicksort(a,l,q-1);
    		 randomized_quicksort(a,q+1,r);
    
    
    		 
    
      }
    int main(){
    	int a[]={12,6,4,7,9,10,11,14,13,19,18,21,20};
    int n=sizeof(a)/sizeof(n);
    randomized_quicksort(a,0,n-1);
     for (int i=0;i<n;i++){
    	 cout<<a[i]<<"  "<<endl;
     }
    
     
    return 0;
    }
it is randomized_quicksort    from introduction in algorithms third edition and   please help 