Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Update contains.js with time and space complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-droi authored May 17, 2024
1 parent 6e80e97 commit 47a57f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions algorithms/JavaScript/src/recursion/contains.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ const contains = (object, checkValue) => {

return false;
};

//Note
//Time Complexity: 𝑂(𝑛) where n is the total number of key-value pairs in the object.
//Space Complexity: 𝑂(𝑑) where d is the maximum depth of nested objects.

0 comments on commit 47a57f4

Please sign in to comment.