Skip to content

Commit

Permalink
Fix codacy errors (iiitv#477)
Browse files Browse the repository at this point in the history
* removed error showed by codacy

* Changed key initialization
  • Loading branch information
devesh-verma authored and aviaryan committed Oct 3, 2017
1 parent a02f273 commit 444d6ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion binary_search/BinarySearch.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public class BinarySearch {

static int binarySearch(int[] arr, int searchElement) {
private static int binarySearch(int[] arr, int searchElement) {
int left = 0;
int right = arr.length - 1;
while (left <= right) {
Expand Down
4 changes: 2 additions & 2 deletions insertion_sort/insertion_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include <stdio.h>

void insertion_sort(int *arr, int arr_size) {
int i, key, j;
int i, j;
for (i = 1; i < arr_size; i++) {
key = arr[i];
int key = arr[i];
j = i - 1;
/* Move elements of arr[0...i-1], that are
greater than key, to one position ahead
Expand Down
4 changes: 2 additions & 2 deletions merge_sort/MergeSort.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public class MergeSort {

static void merge(int[] a, int first, int mid, int last) {
private static void merge(int[] a, int first, int mid, int last) {
int l = mid - first + 1;
int r = last - mid;
int[] left = new int[l];
Expand Down Expand Up @@ -37,7 +37,7 @@ static void merge(int[] a, int first, int mid, int last) {
}
}

static void mergeSort(int[] a, int first, int last) {
private static void mergeSort(int[] a, int first, int last) {
if (first < last) {
int mid = (first + last) / 2; //find the middle
mergeSort(a, first, mid); //sort left half
Expand Down

0 comments on commit 444d6ca

Please sign in to comment.