<commit_before>package com.sorting;

public class HeapSort {
	int heapsize;
	public void buildMaxHeap(int array[]){
		heapsize=array.length;
		for(int i=heapsize/2-1;i>-1;i--){
			maxHeapify(array,i);
		}
	}
	
	
	private void maxHeapify(int[] array, int i) {
		int largest=0;
		int l=left(i);
		int r=right(i);
		if(l<=heapsize && array[l]>array[i]){
			largest=l;
		}else{ 
			largest=i;
		}
		if(r<=heapsize && array[r]>array[largest]){
			largest=r;
		}
		if(largest!=i){
			int temp=array[i];
			array[i]=array[largest];
			array[largest]=temp;
			maxHeapify(	array, largest);
		}
	}
	public int left(int i){
		return 2*i;
	}
	public int right(int i){
		return 2*i+1;
	}

	public static void main(String[] args) {
		HeapSort heap=new HeapSort();
		int[] array={4 , 5 , 45,12 ,5  , 4 , 58 ,5 , 1 };
		heap.buildMaxHeap(array);
		for(int i=0;i<array.length;i++){
			System.out.println(array[i]);
		}
	}

}
<commit_msg>Heapsort try 1<commit_after>package com.sorting;

public class HeapSort {
	int heapsize;
	public void buildMaxHeap(int array[]){
		heapsize=array.length;
		for(int i=heapsize/2;i>-1;i--){
			maxHeapify(array,i);
		}
	}
	
	
	private void maxHeapify(int[] array, int i) {
		int largest=0;
		int l=left(i);
		int r=right(i);
		if(l<=heapsize && array[l]>array[i]){
			largest=l;
		}else{ 
			largest=i;
		}
		if(r<=heapsize && array[r]>array[largest]){
			largest=r;
		}
		if(largest!=i){
			int temp=array[i];
			array[i]=array[largest];
			array[largest]=temp;
			maxHeapify(	array, largest);
		}
	}
	public int left(int i){
		return 2*i;
	}
	public int right(int i){
		return 2*i+1;
	}

	public static void main(String[] args) {
		HeapSort heap=new HeapSort();
		int[] array={4 , 5 , 45,12 ,5  , 4 , 58 ,5 , 1 };
		heap.buildMaxHeap(array);
		for(int i=0;i<array.length;i++){
			System.out.println(array[i]);
		}
	}

}

{'fraction_non_alphanumeric': 0.1821642196846112, 'fraction_numerical': 0.021750951604132682, 'mean_word_length': 3.6700507614213196, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4651628', 'n_tokens_mistral': 894, 'n_tokens_neox': 790, 'n_words': 154}