Understanding how to program sort algorithms is really good for people learning python or those going for a Developer interview where they ask python questions. Asking to program a sort method is a pretty common interview question.
Hey everyone, I tried using the timing decorator and it returns rather than a time. The files timing.py and bubblesort.py are in the same folder. Any ideas as to why the thus would be the case? Thanks! Edit: I got it.. mistyped the code in timing.py 😅
So "for i in items" the i refers to indices? Oh my god I finally get it, thank you! They couldn't even explain it in college when I kept asking about it lol
if you do "for i in items", you're essentially iterating over the list "items" and you'll get one value from the list "item" in "i" for each iteration to get the indices, you can do "for i in range(len(items))" which - for easier understanding - gets the length of your list "item" and creates a list of values from 0 to length of items-1
Understanding how to program sort algorithms is really good for people learning python or those going for a Developer interview where they ask python questions. Asking to program a sort method is a pretty common interview question.
Haha - true. My hubby just had a FB coding interview where he said he had do this sort of thing but with C ++
Best explanation I have ever seen
We need more videos on algorithm
Hey everyone, I tried using the timing decorator and it returns rather than a time. The files timing.py and bubblesort.py are in the same folder. Any ideas as to why the thus would be the case? Thanks!
Edit: I got it.. mistyped the code in timing.py 😅
Hey Dan, I love what you're doing with your community!! Way to go :)
So "for i in items" the i refers to indices? Oh my god I finally get it, thank you! They couldn't even explain it in college when I kept asking about it lol
if you do "for i in items", you're essentially iterating over the list "items" and you'll get one value from the list "item" in "i" for each iteration
to get the indices, you can do "for i in range(len(items))" which - for easier understanding - gets the length of your list "item" and creates a list of values from 0 to length of items-1
@@sprajosh Thanks for the clarification! Appreciate it
Other Data structure algorithm video