Tutor profile: Karina S.
Questions
Subject: Python Programming
What is doctest in python language?
Doctest are useful for debugging, to test your function as you go. eg. factorial def factorial (n): """ >>> factorial ( 1 ): 1 >>> factorial ( 0): 0 """ rs = 1 for i in range( 1 , n +1 ): rs *= i return rs For calling the doctest in the console: python -m doctest factorial.py -v Doctest are used to evaluate the results of an specific function.
Subject: Number Theory
What Kleene Star means in set theory?
Kleene Star is widely used in set theory and automata theory and is an unary operation (operations that include only one operand), is used in sets of strings or set of symbols. Is common used to represent Regex (Regular expressions). Kleene Star core definition means zero or more repetitions excluding epsilon.
Subject: Computer Science (General)
Is in place Merge Sort sorting a good strategy to implement when you want to reduce space in memory?
Merge Sort requires \Theta ( n ) additional auxiliary space to copy the elements of the array. While In-place Merge Sort does not need extra space in memory (auxiliary space), however runs slower than Merge Sort. In-place merge Sort running time > Merge sort running time ( \Theta n log(n) ) In-place merge Sort run slower due the fact that there are many comparisons involved, and also read and write elements of the original array. Because you needs to read , write and swaps more elements of the original array.