Tutor profile: Alex S.
Subject: Python Programming
Since python has no brackets, how does it determine where a function, class, or loop begins and ends?
Python uses whitespace and spacing to determine where a function, class, or loop begins and ends. All function, class, or loops instructions must be indented four spaces to the right of the function, class, or loop header.
Subject: Java Programming
What is the difference between method overriding and method overloading in Java?
An overridden method is a method with both the same signature and parameters as another method. Overridden methods are used for subclasses that must perform the same method as their superclass, but in a different (often more specific) way. An overloaded method is a method with the same signature, but different parameters as another method, this is useful for writing methods that can accept different inputs, but still produce useful outputs.
Subject: Computer Science (General)
What is the worst case and average case time complexities for using the quicksort algorithm on an array of size n?
The average case is O(nlog(n)), and the worst case is O(n^2). How often each case occurs is dependent on the pivot selection algorithm. If the algorithm always selects the first/last element as the pivot, and the data is already sorted it will make n^2 comparisons, since the pivot is always the min/max element. In most other cases, it makes nlog(n) comparisons.
needs and Alex will reply soon.