Skip to content

Latest commit

 

History

History
8 lines (8 loc) · 545 Bytes

Time_complexity.MD

File metadata and controls

8 lines (8 loc) · 545 Bytes

TIPS FOR COMPUTING TIME COMPLEXITY :

  • Don't depend on just loops (either for or while),
  • check actual loop variables whether they are incremented, decremened, multiplied, divided...
  • For linked list, check how much pointer points to elements ?
  • For stacks, queues, dequeus, how many elements are atmost procesed inside these ?
  • For trees and graphs : how many atmost nodes are procesed ?
  • For strings, arrays similar to linked list, how many times we are traversing to each one of those elements, or how much our pointer points to ?