Number Theory for Competitive Programming Using Python - Find Divisors Of A Number O(sqrt(n))

preview_player
Показать описание
Getting started with competetive coding / ds and algo
Title : Number Theory 2
Description :
1.All divisors of number in root n complexity

#CompetitiveProgramming #ProgrammingKnowledge #NumberTheory #Python
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

Efficient codes:
1. Roots of n
arr = []
for i in range(1, n + 1):
if n % i == 0: arr.append(i)
for j in arr: print(j, end = ' ')

2 (a). A prime number (using True and False)
# This is only for n > 1
b = False
for i in range(2, n):
if n % i == 0: b = True; break
if b: return False
return True

2 (b). A prime number (using 0 -> False and 1 -> True)
# This is only for n > 1
b = False
for i in range(2, n):
if n % i == 0: b = True; break
if b: return 0
return 1


Thx :)

EintsWaveX
Автор

na bro don't shift to c++ or any as there are too many resources, continuing in python and cover tree and graph problems, thanks.

shouvikdutta
Автор

Bro why did you used set ?
If I take list I didn't get answer in order.
If you use set then answer is sorted set(but set is unordered ).
How it works can explain ?..plz
Bro help me to get out of the doubt..

marepallinagarjuna
Автор

Please make a tutorial about DEAP library

ismahanearris
Автор

Please make a tutorials on Dynamic Programming in Python

LoneWolf-rjpx
Автор

why is there a star (*) in the print function in front of div1 and div2?

sergeiflozov
Автор

This doesnt include squares.i.e if 36 is taken then the no 6 will be counted twice

pushpaiyer
Автор

Why you declared div2 in func2 as set and later returned it as list when you could have declared it as list directly...is there specific reason for doing that??

GameScapeVids
Автор

Could anyone explain what exactly is T.C. and how it can be calculated?

sergeiflozov
Автор

bhai, plz don't use theme, it hurts eyes to stare in a torch!

aaryamanbhardwaj