Please consider offering answers and suggestions to help other students!
And if you fix a problem by following a suggestion here,
it would be great if other interested students could see a short
"Great, fixed it!" followup message.
Hi,
Just double checking, but I assume that importing standard libraries (e.g. math, collections.deque, etc.) is ok (for labs and for assignments), but importing external libraries (e.g. NumPy) is not permitted?
Thanks )
ANONYMOUS wrote
Heap sort only uses a single heap, though. Heaps are typically implemented as binary trees with the heap property, so maybe you are talking about the subtrees of the heap?
Recall that one of the defining parts of a distribution sort is...
Hi Gozz, thank your clarification. Below I'd like to try my hand at the open-ended questions you have provided.
1. Do you believe heap sort is a distribution sort? What is your argument to support your position? Can you formulate a counterargument?
- F...
ANONYMOUS wrote
These are not exclusive categories. Indeed, as you say, quicksort is both.
Comparison-based sorting algorithms are restricted to only be able to compare elements, and have no other way to get information about their ordering. Quicksort...
Hi I just had a discussion with a friend over Quicksort algorithm and we were confused as to which sort type quicksort is. In the lecture Gozz mentioned it was Distribution sort however when searching online it mentions it is comparison sort. The pa...
https leetcode.com discuss general-discussion 1083445 how-quick-sort-works-and-the-problems-that-can-be-solved-using-partition-logic very interesting resource if you need an example to understand.
ANONYMOUS wrote
It has (currently, at least) been left on the default of scoring first by number of problems completed, then by time penalty. Time penalty is the sum of your submission time in minutes from the start of the "contest", plus 20 minutes ...
Converting the input strings into ints (which is intended), would only take a single linear O(N) scan over the list. It would take this long to even read in the input, so that should not be the dominating factor.
Some questions for you to consider tha...
I am able to get the correct answer however, when it comes to bigger input, my code still takes more than 5 seconds, I think this could be because I'm converting each element in an int first running a loop through it, correct me if I'm wrong.
Hi Professor,
I reviewed last Monday's lecture to see if anything beyond the lecture slides was discussed. However, the recorded video is still the old one with the cut-out audio (as evidenced by the screenshot provided). I was wondering where the new...
I am aware of the issue. Unfortunately, I didn't see until after the lecture yesterday an email that came through warning
I used the pack mic, which appears to have worked in the room, but not for the Echo recording past the first few minutes.
I am pl...