From 41ace4231f75646983f53a086b107a54f689246e Mon Sep 17 00:00:00 2001 From: Prashant Bhapkar Date: Wed, 31 Aug 2022 16:30:53 +0530 Subject: [PATCH] Added running time of algorithm and update readme.md file --- algorithms/C/README.md | 1 + algorithms/C/arrays/secondLargestElement.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/algorithms/C/README.md b/algorithms/C/README.md index 9e241b51..50a7eb55 100644 --- a/algorithms/C/README.md +++ b/algorithms/C/README.md @@ -7,6 +7,7 @@ - [Reverse an array](arrays/reverse-array.c) - [Maximum difference](arrays/maximum-difference.c) - [Largest Element](arrays/largestElement.c) +- [Second Largest Element](arrays/secondLargestElement.c) - [Sieve of Eratosthenes](arrays/sieve-of-eratosthenes.c) ## Bit Manipulation diff --git a/algorithms/C/arrays/secondLargestElement.c b/algorithms/C/arrays/secondLargestElement.c index 04263d26..34b81d12 100644 --- a/algorithms/C/arrays/secondLargestElement.c +++ b/algorithms/C/arrays/secondLargestElement.c @@ -28,3 +28,11 @@ int main() second(arr,size); return 0; } + +/* +----------------Sample Output---------------- +> 88 45 + +Time Compexity: O(n) +Space compexity: O(1) +*/