Пікірлер
@musingsfromthemindof
@musingsfromthemindof Сағат бұрын
1. Failed sort list requirement 2. An exception would fire is the list only has 1 item.
@ZeKermet
@ZeKermet Күн бұрын
Step 0: why do you need 10 billion elements?
@confidential303
@confidential303 Сағат бұрын
In case you want to add 10 billion + 10 billion. You then can do a trick sum = large_number[-1] + large_number[-1]
@Haddedam
@Haddedam Күн бұрын
If your task is find largest without sorting or some other ultra specific once in a lifetime use case, you could also find max, remove max from list and find max again. Or if no preprogrammed whatever you call those things is allowed, then instead of iterating through the list for one max value, you have max and previous max.
@black_crest
@black_crest Күн бұрын
Shouldn't an integer only take up 32 bits or 4 bytes on a 64 bit system? Why 28 bytes?
@kareems5126
@kareems5126 Күн бұрын
Just build a backend at this point with the data
@andreaselfving2787
@andreaselfving2787 2 күн бұрын
How can you now know how aliasing works if you've actually used python for more than textbook examples?
@TheCodeGriffin
@TheCodeGriffin 2 күн бұрын
I'd rather have O(1) indexing than O(1) insertion. Linked lists have an O(n) time complexity for selection, which is less desirable in most cases.
@mrtoine5902
@mrtoine5902 2 күн бұрын
who tf runs this channel, it consistently posts literally the worst python content out there
@infinity_6976
@infinity_6976 2 күн бұрын
print(max(numbers.remove(max(numbers))))
@wong_tai_ming
@wong_tai_ming 2 күн бұрын
Can easily be solved with two pointers
@infiteri6030
@infiteri6030 2 күн бұрын
Wont that be O(2n)? Assuming we beed the employee list back as an array, making a deque shoukd be O(n) and making a list from it should also be O(n). Btw i might be wrong, just asking
@dk4kja8
@dk4kja8 2 күн бұрын
"objects take up space in memory" So do integers 💀
@kizza9321
@kizza9321 2 күн бұрын
They take up much more space than plain integers.
@dk4kja8
@dk4kja8 2 күн бұрын
@@kizza9321 i know
@dk4kja8
@dk4kja8 2 күн бұрын
@@kizza9321 not rlly actually only 1 byte
@averagesoul8256
@averagesoul8256 2 күн бұрын
def f(a,b): return a+b print = f this is actually replacing print
@rniggardson
@rniggardson 2 күн бұрын
Only losers don’t know this. 😂
@kavuruvamsikrishna02
@kavuruvamsikrishna02 3 күн бұрын
awesome, nice
@talk9415
@talk9415 4 күн бұрын
Are you a clown? This is painful to watch.. I lasted 9 seconds... First import a new collection, then create a new structure, copy all elements there... Dude programming isn't your thing
@faisalmehmood5375
@faisalmehmood5375 4 күн бұрын
You literally sorted the list tho. So you failed your own question.
@shalevforfor5550
@shalevforfor5550 4 күн бұрын
thats a mistake rhat some people does without even knowing they did it because it has a very little error
@robbyoconnor
@robbyoconnor 4 күн бұрын
Don't use eval() without guardrails It's not hard to do this without eval()
@easobral
@easobral 4 күн бұрын
now you are using more memory and average access time to a random element has also increased. You must know how it would be used to say something is better or worse. If you insert only now and then, but access it way more frequently, then you have created a bottleneck. There is no free lunch.
@barmalini
@barmalini 4 күн бұрын
use generator, silly
4 күн бұрын
In a way, this function IS indeed super useful: if you spot any piece of code using this function, you know immediately who to fire and report to the feds 😂
@linearnorth1233
@linearnorth1233 4 күн бұрын
hashmap?
@devnarula6733
@devnarula6733 5 күн бұрын
"most programmers don't know this"... proceeds to show this
@SanjayS-xd5yw
@SanjayS-xd5yw 5 күн бұрын
I have seen lot of video about python. But in your channel you teach everything in-depth it really helpful us for clear understanding
@mesmeridze1
@mesmeridze1 5 күн бұрын
Day by day I like lists less and less 😊
@averagesoul8256
@averagesoul8256 5 күн бұрын
this intern should be fired
@EslamEmam-gi5vk
@EslamEmam-gi5vk 6 күн бұрын
pop max then max ?
@tamirshalev9019
@tamirshalev9019 6 күн бұрын
This is not true for nested dictionaries, I believe its important to mention
@okielama
@okielama 7 күн бұрын
This is so stupid
@trevor3905
@trevor3905 8 күн бұрын
For this problem specifically, would you be able to reverse the list, append, and reverse again? What is time complexity of that?
@hariharan3381
@hariharan3381 7 күн бұрын
😂 2 times O(n)
@triip333
@triip333 8 күн бұрын
manual says: Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”).
@Havoc10140
@Havoc10140 9 күн бұрын
"Hey can you sort my data but only a little bit?"
@konstantinvyacheslavovich8217
@konstantinvyacheslavovich8217 9 күн бұрын
How about joblib is it same ?
@alishbamujtaba1995
@alishbamujtaba1995 9 күн бұрын
Why are there small bubbles 🫧 ig, or little bugs running around your screen?
@Nishwantsboobs
@Nishwantsboobs 9 күн бұрын
Dictionary is in imutable datatype
@zuja1
@zuja1 9 күн бұрын
Wtf is this shit?
@ArmirMitrandir
@ArmirMitrandir 9 күн бұрын
if you need speed and efficiency, just use sth else
@Manojkumar__
@Manojkumar__ 9 күн бұрын
who the hell is using variable name as Exception ??
@onehmong9368
@onehmong9368 10 күн бұрын
Negative
@Sreekumarvpl
@Sreekumarvpl 10 күн бұрын
This is not useful.
@Sreekumarvpl
@Sreekumarvpl 10 күн бұрын
You are unnecessarily creating a dictionary here. We can achieve it directly using a for loop by appending to a list and ignoring the already added entry. Or by using list comprehension checking the index with the original list.
@Sreekumarvpl
@Sreekumarvpl 10 күн бұрын
Dont suggest this kind of things in your video. As per official python documentation: """ Warning: This function executes arbitrary code. Calling it with user-supplied input may lead to security vulnerabilities. """
@yehorishtvan3802
@yehorishtvan3802 10 күн бұрын
Nice man, deque - i dont use for python, only for c++. Its interesting o(n) and o(1)
@shyamgurunath5876
@shyamgurunath5876 10 күн бұрын
Two pointer would solve these in o(logn)
@averagesoul8256
@averagesoul8256 10 күн бұрын
no intern will ever be tasked with something like this. theyll make a div red from blue at best
@hariram8022
@hariram8022 10 күн бұрын
Hey hi everyone I am that new intern he's been talking about in every video .he ows me credits for that🙂‍↔️
@七人の侍-b1q
@七人の侍-b1q 10 күн бұрын
When tf would I ever have to do this?
@andreaselfving2787
@andreaselfving2787 10 күн бұрын
But you create new items?
@ncmathsadist
@ncmathsadist 10 күн бұрын
It's a giant security hole. Beware.