Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a question if I use iteration instead of recursion, don't you think the Big O notation will become O=(n) for searching, inserting, and deleting. You are also right that I can hit the maximum recursion limit but if I use iteration then it kinda kills the point of making a binary tree in the first place, why not make an array or list and then apply binary search over it?
@AMC yeah it was alien invasion i think where I changed the if condition for arrow keys to elif, Before that the spaceship always take 1 sec delay in response to the key i press. But after that i started responding fast, i should not have said the higher FPS because its not related to the frames, it is just the execution of the program.
Yup! that was really helpful, your method reduced the coding. I remembered that how If statement slows the program execution, it will not matter in this program but when i was making few games in pygame, a lot of if statements were really giving me low FPS. thanks today i learned 2 new techniques. i never thought i can do this thing: ingredients.append(pyp.inputMenu() i never appended something like this, maybe in list comprehension but not like this.