When the interviewer asks for the complexity, do they want the amortised bound or the worst case for a single operation? I keep giving one and being asked for the other.
Classroom
Lecture stage
Opening your classroom
Choose a lecture from the syllabus
Video streaming isn’t connected yet
Transport controls switch on with the media pipeline. Playback speed is live now — it sets how quickly a lecture is marked viewed.
Course complete
Lecture material
About this lecture
Your notes
Kept against this lecture only, on this device. They save a moment after you stop typing.
0 of 5,000 characters
Lecture resources
Slides, practice sets and starter code are published alongside the lecture media. They are not available yet.
Transcript
Transcripts are generated from the lecture audio track.
There is no audio to transcribe yet
Video streaming isn’t connected, so no transcript exists for this lecture. Once the media pipeline is live this panel carries a time-stamped transcript you can search and jump from.
Discussion
A snapshot of what this cohort asked. Replies are read-only in the classroom.
-
-
Say both, in that order: worst case for one operation, then the amortised bound over a sequence, then which one matters for the problem in front of you. That last sentence is the one that scores.
-
Adding what helped me: I write the invariant above the loop before writing the loop. Half my off-by-one bugs stopped happening.