Forum tips

Writing in Hebrew
If you post a forum message in Hebrew (or English mixed with Hebrew), add[[div style="direction:rtl;"]]
before your message, and[[/div]]
after it (each on a separate line).

Including Python code
When including python code in your message, if you don't want to lose the indentation, and also benefit from syntax highlighting, add[[code type="python"]]
before the code, and[[/code]]
after it (each on a separate line).

BoldPut ** before and after the text: a**b**c —> abc

UnderlinePut __ before and after the text: a__b__c —> abc

Raw textPut @@ before and after the text, to ignore formatting: @@a**b**c@@ --> a**b**c

Adding or removing an element to an k long list would take O(k) steps in the worst case.

You could use "external functions" provided they were used in a class or a recitation, but not any other such functions.

(Suppose we ask you, for example, to generate the moves in a Rubik cube path from a given cube configuration. Furthermore, suppose Python happens to have an appropriate package with a function that solves just that. We
will not accept the following solution

a single append (addition at the end of a list) usually takes O(1), except for when the list is full and has to be relocated in memory. This happens not too often (if the list size is enlarged substantially in such cases), but it still takes O(n) for a single append.

However, if indeed the list size is enlarged enough each time it gets full, say X2, then one can show these costly relocations will happen once every O(n) operations. So on average, append takes O(1). BTW this is called amortized complexity, and you'll see it again in "data structures".