Рет қаралды 15,925
Data Structures and Algorithms Free Course (Learn DSA Without Paise) Playlist - • Data Structures And Al...
We are up with the lecture 11 of our much awaited dsa course in java.
As we are moving ahead with the module of mathematics in our free dsa course, we are coming up with more interesting and complex problems which have high probability of coming in the interview rounds.
In the previous lecture 10 of our dsa course, we understood the logic behind writing a program for finding if a number is prime of not.
The next problem that we will be solving in this lecture is to find all the prime numbers between 1 to n where n is any natural number.
There is a simple approach to the same where you can call the isprime function and use it to check each number from 1 to n with the help of a loop.
The problem with this approach is it's time complexity and hence this approach of finding prime numbers in not efficient.
Hence we'll learn about a new algorithm known as Sieve Of Eratosthenes which is one of the quickest ways to find the prime numbers.
Let's see the implementation of this algorithm using a program in Java.
Subscribe to our channel for regular updates on the dsa course and click on the bell icon to never miss an update from our dsa course.
For more information, fill this form: forms.gle/8eiUmM92Fx563Aen9
or call us at 8884881203
Facebook: / thetapacademy
Instagram: / tapacademy_online
Linkedin: / 73820805
Website: www.thetapacademy.com
#dsa #dsacourse #java #dsainjava #javaprogramming #coding #coder