Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
viren-sureja committed Jan 29, 2022
1 parent e1ac482 commit 12d8b7f
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions 01_array/05_negative_ele_to_one_side_of_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ void arrange(int a[], int n) {
}
else if (a[negi] > 0 && a[posi] > 0) posi--;
else {
low++;
high--;
negi++;
posi--;
}
}
}
2 changes: 1 addition & 1 deletion 01_array/09_minimize_the_height.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ int getMinDiff(int arr[], int n, int k) {
ans = min(ans, curr_max - curr_min);
}
return ans;
}
}
3 changes: 1 addition & 2 deletions 01_array/12_merge_2_sorted_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ void merge(int ar1[], int ar2[], int n, int m)
int i, last = ar1[n - 1];

// here array will be making space for the new element to insert
for (i = n - 2; i >= 0
&& ar1[i] > ar2[j]; i--)
for (i = n - 2; i >= 0 && ar1[i] > ar2[j]; i--)
ar1[i + 1] = ar1[i];

// If there was a greater element
Expand Down
2 changes: 1 addition & 1 deletion 01_array/16_count_inversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
video (recommended to save time): https://youtu.be/kQ1mJlwW-c0
condition here is convertion counts if (arr[i]>arr[j] && i<j) <-- keep in mind everytime
condition here is convertion counts if (arr[i]>arr[j] && i<j) <-- keep this in mind everytime
*/


Expand Down
2 changes: 1 addition & 1 deletion 06_binary_trees/03_height_of_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ int height(struct Node* node)
return rHeight + 1;
}
}
}
}
3 changes: 1 addition & 2 deletions 12_graph/12_dijkstra_algo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ int main() {
pq.push(make_pair(distTo[next], next));
}
}

}

cout << "The distances from source, " << source << ", are : \n";
for (int i = 1; i <= n; i++) cout << distTo[i] << " ";
cout << "\n";

return 0;
}
}
1 change: 1 addition & 0 deletions 12_graph/18_implement_kruskals_algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void unionn(int u, int v, vector<int>& parent, vector<int>& rank) {
rank[u]++;
}
}

int main() {
int N, m;
cin >> N >> m;
Expand Down

0 comments on commit 12d8b7f

Please sign in to comment.