High Definition Standard Definition Theater
Video id : ALiQ8YT_XGo
ImmersiveAmbientModecolor: #efefef (color 1)
Video Format : 22 (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: Opus - Normalized audio
PokeTubeEncryptID: 7ba71c511dc5200589f300058f47aed536ed7e6ffc83744b0353c606e93bb5298d92b1af70e47727d5611d173385727b
Proxy : eu-proxy.poketube.fun - refresh the page to change the proxy location
Date : 1719729868789 - unknown on Apple WebKit
Mystery text : QUxpUThZVF9YR28gaSAgbG92ICB1IGV1LXByb3h5LnBva2V0dWJlLmZ1bg==
143 : true
Java 8 Program 3 - Find the Second Largest Number in the List of Integers #java #interview #coding
Jump to Connections
21,253 Views • Feb 18, 2024 • Click to toggle off description
Finding the second largest number in a list of integers is a common problem that tests a programmer's ability to manipulate collections and understand sorting mechanisms. In this blog post, we will tackle this problem using Java 8's Stream API, demonstrating an efficient and concise way to find the second largest number in a list.

Complete Playlist:    • Shorts on Java Interview Q&A  
Metadata And Engagement

Views : 21,253
Genre: Education
Date of upload: Feb 18, 2024 ^^


Rating : 4.481 (166/1,113 LTDR)

87.02% of the users lieked the video!!
12.98% of the users dislieked the video!!
User score: 80.53- Overwhelmingly Positive

RYD date created : 2024-04-17T12:24:13.003031Z
See in json
Tags
Connections
Nyo connections found on the description ;_; report a issue lol

YouTube Comments - 30 Comments

Top Comments of this video!! :3

@opmarathi64

3 months ago

These type of vedioes want more

|

@TruthSeeker-zl5uo

4 months ago

No need to sort in order to get second largest number, its ineffective

3 |

@AbhinavSingh-up7bl

4 months ago

in C++ #include <bits/stdc++.h> using namespace std; int main() { int arr[] = {65,7,8,6,78,56,78,78,44,78,90}; set<int>array; for(auto values:arr) array.insert(values); auto it = array.end(); cout<<"First Bigest Value = "<<*--it<<endl; cout<<"Second Bigest Value = "<<*--it<<endl; return 0; }

1 |

@shubhamuppal-1599

3 months ago

Nlogn is waste in this case. Try to do in 2n space complexity. In 1st iteration find max. In 2nd iteration maintain var- second largest and second so far. Keep iterating updating if no is less than max.eazyyyy

1 |

@SiddharthKulkarniN

4 months ago

Quick select please.

|

@PravinKumar-yf8tt

4 months ago

I think list index starts with 0 ?.. correct me if im wrong

|

@sharathinfotech

4 months ago

But in case of the duplicate number ?and how to find the index of the second largest number in the array

|

@abineshcoder

4 months ago

Collections.sort(listOfIntegers); Integer res = listOfIntegers.get(listOfIntegers.size() -2); System.out.println(res); The space complexity for this program is O(1) Your program consumes extra memory so O(n)

4 |

@itz_Manish02

3 months ago

if we have 88,88,76 then 💀💀

1 |

@thatguyadarsh

4 months ago

To handle duplicate entries what can we do here ?

|

@liqwis9598

4 months ago

What about for non primitive data Ramesh?

|

@raaviyashwanth2294

4 months ago

Index must be 0 for first number right??

|

@atamishali

4 months ago

Interviewers won't let you use built in functions

|

@Mig440

4 months ago

Oh.... cant you really not use newer java versions... java 8 is too ancient 😂😂

|

Go To Top