Skip to content

Commit 140b0cc

Browse files
Merge pull request #376 from kartikay23/main
Updated README file
2 parents 8f1c4cb + b7d221a commit 140b0cc

File tree

2 files changed

+4
-4
lines changed
  • 02. Algorithms

2 files changed

+4
-4
lines changed

02. Algorithms/01. Arrays/02. Find the maximum and minimum element in an array/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
### Editorial Link: https://www.geeksforgeeks.org/maximum-and-minimum-in-an-array/
33

44

5-
- ## Approach 1: Sort the Array, TC = O(nlog(n))
5+
- ## Approach 1: Sort the Array, Time Complexity = O(nlog(n))
66
```java
77
//User function Template for Java
88

@@ -62,7 +62,7 @@ class Compute
6262
}
6363
```
6464

65-
- ## Approach 3: Tournament Method (Divide and Conquer), TC = O(n) but lesser number of comparisons
65+
- ## Approach 3: Tournament Method (Divide and Conquer), Time Complexity = O(n), but lesser number of comparisons
6666
Divide the array into two parts and compare the maximums and minimums of the two parts to get the maximum and the minimum of the whole array.
6767
```java
6868
//User function Template for Java
@@ -122,7 +122,7 @@ class Compute
122122
```
123123

124124

125-
- ## Approach 4: Compare in Pairs, TC = O(n)
125+
- ## Approach 4: Compare in Pairs, Time Complexity = O(n)
126126
If n is odd then initialize min and max as first element. <br>
127127
If n is even then initialize min and max as minimum and maximum of the first two elements respectively. <br>
128128
For the rest of the elements, pick them in pairs and compare their maximum and minimum with the current max and min respectively.

02. Algorithms/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## **Algorithms :-**
88

9-
**An algorithm is any approach you use to perform operations on data (like searching, sorting, traversing, etc).**
9+
**An algorithm is a step by step procedure to solve logical and mathematical problems. It is any approach you use to perform operations on data (like searching, sorting, traversing, etc).**
1010

1111
<hr>
1212

0 commit comments

Comments
 (0)