Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 523 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 523 Bytes

Time Complexity Analysis in Code

Example code to demonstrate differences between time complexities.

How to use

Install dependencies:

npm install

Start program:

npm start

Counting steps

  1. Initialize a new instance of the Counter class inside a function:
const counter = new Counter();
  1. For each step, call the increment function
counter.inc();
  1. Get the total count by using the total property
const total = counter.total;