2. Second Largest Element || Arrays Problem Solving

  Рет қаралды 3,589

TechStoriesOfSrinidhi

TechStoriesOfSrinidhi

Күн бұрын

#softwareengineer #coding #datastructuresintelugu #datastructures #algorithm #interview #practiceDSA

Пікірлер: 63
@vinay_sandeep
@vinay_sandeep Ай бұрын
Akka ni explanation super chala easy ga ardham avvutundhi ❤
@balajib2498
@balajib2498 Ай бұрын
Great explanation sister, beginner point of view nunchi alochinchadam great sister. easy to medium and then hard ane point is very good and will help many beginners. problem explanation ayipoyaka same topic meedha another problem suggest chesi task complete cheyamanadam naku baaga nacchindhi sister. future lo kuda meeru explain chesina tharuvatha related problems task laaga is the chaala help avutadhi sister.
@Durga_Naveen
@Durga_Naveen Ай бұрын
Your Explanation is very good
@robertpramodh5636
@robertpramodh5636 Ай бұрын
Thank you for such a great explanation of DSA. Your teaching style is really clear and helpful. For future videos, Could you also include the logic in pseudocode? This might make it easier for viewers from different programming backgrounds to understand the core concept and apply it in their preferred language.
@godofsyco4615
@godofsyco4615 Ай бұрын
I am learning so much from you for free love your content
@sadhikpathan6091
@sadhikpathan6091 Ай бұрын
Nice explanation..Tqsm...New subscriber added to your family ..🙂.plss continue cheyyandi...Mee channel definite gaa success ithadi 😇
@harsa208
@harsa208 Ай бұрын
Nice akka me explanation chala bagundi..meru dsa Ela neruchukunaruuu....manchi dsa books referen cheyyandi enka manchi Telugu dsa KZbin channel s reffer cheyyandi akkaaa
@ThabrejShaik
@ThabrejShaik Ай бұрын
Thank you for providing such a clear and insightful explanation of DSA! Your teaching style makes complex concepts easy to understand. It would be great if future videos included the logic in pseudocode. This approach could help viewers from different programming backgrounds understand the core ideas more effectively. Pseudocode would also make it easier for learners to implement the concepts in the programming language of their choice. Including this addition could broaden the accessibility and impact of your content.
@muraliyelliboina4871
@muraliyelliboina4871 19 күн бұрын
second largest element in an array in a single loop class Solution { public int getSecondLargest(int[] arr) { // Code Here int first=-1,second=-1; if(arr.length==1) { return -1; } for(int i=0;i
@PavanKumar-kv7ur
@PavanKumar-kv7ur Ай бұрын
Hi @srinidhi, I have subscribed your channel to learn DSA completely, please post the videos ONE BY ONE on your free time , and i need learn and get the knowledge of problem solving using DSA 😊
@veerareddy5694
@veerareddy5694 Ай бұрын
Akka super akka, continues ga cheye akka super ga unnaye akka videos akka
@goo-pro5648
@goo-pro5648 Ай бұрын
n = len(arr) c = 0 for i in range(n): if arr[i] == arr[n - i -1]: c+=1 if c == n: print('Done')
@Eswar_12
@Eswar_12 Ай бұрын
Keep continue akka
@g.upenderreddy
@g.upenderreddy Ай бұрын
class Solution { public int getSecondLargest(int[] arr) { // Code Here int largest = -1, secondLargest = -1; for (int i : arr) { if (i > largest) { secondLargest = largest; largest = i; } else if (i < largest && i > secondLargest) { secondLargest = i; } } return secondLargest; } } class Solution { public static boolean isPerfect(int[] arr) { // code here int left = 0, right = arr.length - 1; while (left++ < right--) { if (arr[left] != arr[right]) { return false; } } return true; } }
@Sharat-bj5hz
@Sharat-bj5hz Ай бұрын
int[] array = { 0, 1, 8, 2, 8, 1, 3 }; int start = 0; int end = array.Length - 1; bool flag = true; while (start < end) { if (array[start] != array[end]) { flag = false; break; } start++; end--; } Console.WriteLine(flag); I have implemented based on your reverse array problem...Thanks
@Mukeshsainaidu
@Mukeshsainaidu Ай бұрын
Brutefore approach: class Solution: def getSecondLargest(self, arr): # Code Here max = arr[0] for i in arr: if i > max: max = i for i in range(0,len(arr)): if arr[i] == max: arr[i] = 0 m = 0 for i in arr: if i > m: m = i if m !=0: return m return -1
@ANURADHA-n4z9j
@ANURADHA-n4z9j Ай бұрын
l=list(map(int,input().split())) g=sorted(set(l)) if (len(g)==1): print(-1) else: print(g[-2])
@kalyanchandrakongari5856
@kalyanchandrakongari5856 Ай бұрын
n=len(arr) largest_num = -1 second_largest_num = -1 for i in range(n): if arr[i] >largest_num: second_largest_num = largest_num largest_num = arr[i] elif arr[i] < largest_num and arr[i] > second_largest_num: second_largest_num = arr[i] return second_largest_num
@sukeshsunkari
@sukeshsunkari Ай бұрын
public class palindrome { public static void main(String[] args) { int[] arr={5,0,1,1,0,5}; System.out.println("Palindrome check : "+checkpalindrome(arr)); } private static boolean checkpalindrome(int[] arr) { boolean flag=true; int n=arr.length-1; for (int i = 0; i
@smpgamingfreefire5621
@smpgamingfreefire5621 Ай бұрын
Face cam unte physical ga class lo kurchoni vintunnattu ga undedhi, ippudu online class la undhi.😢
@SAIHARSHAP
@SAIHARSHAP 10 күн бұрын
ranges::sort(a); A.Unique(erase(A.begin(),A.end()),A.end()) Return a.end()[-2];
@Programming_life_
@Programming_life_ Ай бұрын
Akka nenu eroju ade video petina youtube lo
@opgamer6838
@opgamer6838 Ай бұрын
class Solution { isPerfect(arr) { var left = 0; var right = arr.length - 1; while (left < right) { if (arr[left] != arr[right]) { return false; } left++; right--; } return true; } }// javascript
@MahithaMekala
@MahithaMekala Ай бұрын
public class example { public static void main(String args []){ int arr[]={1,2,5,3,7}; int max=arr[0]; int minvalue=arr[0]; for(int i=1;imax){ minvalue=max; max=arr[i]; } else if(minvalue
@charuwaka1
@charuwaka1 Ай бұрын
Well Optimized Java Solution public int getSecondLargest(int[] arr) { if (arr.length < 2) return -1; int max = Integer.MIN_VALUE, secondMax = Integer.MIN_VALUE; for (int num : arr) { if (num > max) { secondMax = max; max = num; } else if (num > secondMax && num < max) { secondMax = num; } } return secondMax == Integer.MIN_VALUE ? -1 : secondMax; }
@harshitayadav1838
@harshitayadav1838 Ай бұрын
akka from onwards leectcode question link in description
@pavanspecialvideos..3579
@pavanspecialvideos..3579 Ай бұрын
Akka vaka for loop lo kuda cheyyachu ga..fl lo 0th variable ni initialize cheshi and sl lo -1 ni initialize cheshi manaki fl first dhani kante big ayyithe fl lo I value petti and sl fl value pettuna avvuthundhi ga..akka
@pavanspecialvideos..3579
@pavanspecialvideos..3579 Ай бұрын
Fl is first largest and sl is second largest
@Arjun-hc7ow
@Arjun-hc7ow Ай бұрын
arr = [] n = len(arr) left = 0 right = n-1 While left < right: If arr[left] != arr[right]: return False left += 1 right -= 1 return True
@moranandini278
@moranandini278 Ай бұрын
Please explain python also
@praveenk3846
@praveenk3846 Ай бұрын
Akka DSA with python chey❤
@vamsipreetham6224
@vamsipreetham6224 Ай бұрын
Max1,max2=0,0 If len(arr)==1: Print(-1) For i in range(len(arr)): If max1 < arr[i]: max2= max1 max1 = arr[i] If max1==max2: Print(-1) Print(max2)
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
This wont work oka case miss aythunav, run chesi chud code
@vamsipreetham6224
@vamsipreetham6224 Ай бұрын
@@TechStoriesOfSrinidhi max1, max2 = 0, 0 arr = [10, 10, 9] if len(arr) == 1: print(-1) for i in range(len(arr)): if max1 < arr[i]: max1 = arr[i] elif max2 < arr[i] and arr[i] < max1: max2 = arr[i] print(max2) I think this works
@vamsipreetham6224
@vamsipreetham6224 Ай бұрын
Thank you for your response and support you got great content and will shine as a top youtuber in upcoming days.... in Telugu.
@dhanushperumalla773
@dhanushperumalla773 Ай бұрын
arr = [10,20,30,40,20] if len(arr) < 2: print("False") else: high = 0 second_highest = 0 for x in range(0,len(arr)): if arr[x] > high: second_highest = high high = arr[x] elif arr[x] > second_highest and arr[x]!= high: second_highest = arr[x] print(high) print(second_highest)
@a-oneinclined920
@a-oneinclined920 Ай бұрын
Python lo chppandi bro....ledu ante poll pettandi to continue explaining in which language anii......
@NakkaChaitra-ie7ip
@NakkaChaitra-ie7ip Ай бұрын
mam meru 6:30 o(nlogn) andhe divide chesthe vasthadhi annaru kada mam time complexity cheppina appudu kani ikkada manam ye divide method use cheyaledu kada mam kani yela o(nlogn)vachidhi chepthara please ardham kaledhu mam time complexity
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
@@NakkaChaitra-ie7ip prathi step lo array ni oka specific size reduce cheste O(logn) aythadi TC ani cheppa yes, ikkada manam brute force approach lo array ni descending order lo sort chestunam, best sorting algorithm TC is O(nlogn) idi ela vachindo manam sorting topic apudu discuss chedam
@NakkaChaitra-ie7ip
@NakkaChaitra-ie7ip Ай бұрын
@@TechStoriesOfSrinidhi ok mam thank u for clarification
@saikeerthi-c9h
@saikeerthi-c9h Ай бұрын
if (s==s[::-1]): return True else: return False is it correct
@Mr.venky6539
@Mr.venky6539 Ай бұрын
Telugu lo DSA enthakanna Baga explain chese vallani chupisthy life time settlements 🤫
@Arjun-hc7ow
@Arjun-hc7ow Ай бұрын
@@Mr.venky6539 Engineering animuthyam
@ANURADHA-n4z9j
@ANURADHA-n4z9j Ай бұрын
l=list(map(int,input().split())) if(l[:] == l[::-1]): print("palimdrome") else: print("not a palindrome")
@gunasai5572
@gunasai5572 Ай бұрын
def palindrome_not(arr): reverse_array = arr[::-1] if original_array == reverse_array: return True else: return False original_array = [1,2,1] print(palindrome_not(original_array))
@slimshady-marshal
@slimshady-marshal Ай бұрын
Super akka
@NakkaChaitra-ie7ip
@NakkaChaitra-ie7ip Ай бұрын
mam ikkada manam yenduku largest and second largest ni -1 tesukunnamu why not 0 mam both variables intialization
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
0 ayna teskovachu or INT_MIN ayna teskovachu nen base value like second largest lekapothe -1 return cheyamanad kadaa so -1 teskunaa
@NakkaChaitra-ie7ip
@NakkaChaitra-ie7ip Ай бұрын
@@TechStoriesOfSrinidhi ok mam
@botlayogi7213
@botlayogi7213 23 күн бұрын
public static boolean isPerfect(int[] arr) { // code here int start = 0; int end = arr.length - 1; for(int i =0; i
@4A8552
@4A8552 Ай бұрын
s=[1,2,1] t=s[::-1] if s==t: print("True") else: print("False") Akka check this code whether it is right or wrong plz reply? Palindrome array code?
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
Correct ey kani ikkada nuv extra space vadthunav….’t’ lo reversed list store cheskoni compare chestunav which takes O(n) space….nenu space complexity O(1) undali anna….try alochinchu extra space lekunda ela solve cheyochoo
@4A8552
@4A8552 Ай бұрын
@@TechStoriesOfSrinidhi kk akka
@Hellohgf
@Hellohgf Ай бұрын
​@@TechStoriesOfSrinidhi extra space ekkada undhi akkkadaaa
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
Thanu reversed array ‘t’ lo store cheskunad adi extra space eh kadaa
@Hellohgf
@Hellohgf Ай бұрын
@@TechStoriesOfSrinidhi s=[1,2,1] If(s==s[::-1]: Print(True) Else: Print(false) Is this correct
@sridevi844
@sridevi844 Ай бұрын
public class Main { public static void main(String[] args) { int[] arr={1,2,3,4,3,2,1}; boolean b=true; int i=0,j=arr.length-1; while(i
@Charan293
@Charan293 Ай бұрын
Arr={1,2,1} If(arr=arr[::-1]) Print("it is a palindrome") else Print("it is not a plaindrome") Is this crct or not !!!! Once reply it
@ravishanker827
@ravishanker827 Ай бұрын
?????????????Time and space complexity ardham kale mundhu video?????????????? Inkoka video cheyachukadha
@dhanushperumalla773
@dhanushperumalla773 Ай бұрын
arr = [10,20,30,20,10] rev_arry = arr[::-1] if arr == rev_arry: print("Palindrome") else: print("Not a Palindrome")
@TechStoriesOfSrinidhi
@TechStoriesOfSrinidhi Ай бұрын
Extra space use chesaru to store rev_arry. Space complexity O(1) undali
@botlayogi7213
@botlayogi7213 23 күн бұрын
// Code Here if(arr.length < 2){ return -1; } int fLargest = Integer.MIN_VALUE; int sLargest = Integer.MIN_VALUE; for(int a : arr){ if(a > fLargest){ sLargest = fLargest; fLargest = a; } else if(a > sLargest && a != fLargest ){ sLargest = a; } } if(sLargest == Integer.MIN_VALUE) return -1; else return sLargest;
@nazeertheofficial
@nazeertheofficial Ай бұрын
arr1 arr2.reverse() return "".join(arr1)=="".join(arr2)
3. Merge Sorted Arrays || Arrays Problem Solving
36:39
TechStoriesOfSrinidhi
Рет қаралды 3,3 М.
1. Move Zeroes || Arrays Problem Solving
20:37
TechStoriesOfSrinidhi
Рет қаралды 8 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Time and Space Complexity || DSA Series
21:29
TechStoriesOfSrinidhi
Рет қаралды 14 М.
Arrays || DSA series video - 3
27:59
TechStoriesOfSrinidhi
Рет қаралды 9 М.
My Honest Microsoft Interview Experience
17:52
TechStoriesOfSrinidhi
Рет қаралды 77 М.
Never Loose Hope - Your Time is Coming!
13:02
TechStoriesOfSrinidhi
Рет қаралды 14 М.
A Simpler Way to See Results
19:17
Logan Smith
Рет қаралды 121 М.
Top Tech Jobs With Low Code or No Code
9:46
TechStoriesOfSrinidhi
Рет қаралды 7 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН