Loading...
Engaged Employer
Generate the first n prime numbers and time complexity.
Anonymous
Generate tuples whose sum is 10 and time complexity.
private static void generatePrime(int n) { for(int i = 2; i < n; i++) { boolean status = true; for(int j = 2; j <= Math.sqrt(i); j++) { if(i%j == 0) { status = false; } } if(status) System.out.print(i+", "); } }
time complexity is nlogn
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.