Some of my tests and analysis done during Algorithms and Data Structures course
Experiment idea:
- make list with a range numbers in it
- pick random number and check if is in the list
- repeat for dictionary (numbers as keys)
Speed comparison of:
- concat
- append
- comprehension
- list range
- pop:
- pop first
- pop last
Results:
Nothing unexpected except one thing. I expected pop(0) to be O(n) and pop(1) -> O(1), while it looks like both are O(1). To check.
Stack implementation - stack class ("list like") witk some basic methods.
stack_bin_to_dec - practical test od Stack class. Function conwerting decimal numbers to "any-base" number.
Queue implementation - queue class ("list like") witk some basic methods.
queue_printer_simulator - practical test od Stack class. (Not finished yet)