Skip to content

add o-n first #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# JavaScript Algorithms And Data Structures
## JavaScript based examples of many algorithms and data structures.
☝ Note that this repository is meant to be used for learning and researching purposes only.

What you will learn in here.

Technical:
Expand Down
16 changes: 16 additions & 0 deletions section-big-o/o-n-001.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const fish = ['dory', 'bruce', 'marlin', 'O_n-001'];
const single = ['O_n-001'];
const everyone = ['dory', 'bruce', 'marlin', 'O_n-001', 'gill', 'bloat', 'nigel', 'squirt', 'darla', 'hank'];
const large = new Array(100000).fill('O_n-001');


function findSpecificNameFromArray(array) {
for (let index = 0; index < array.length; index++) {
const element = array[index];
if (element === 'O_n-001') {
console.log('Found O_n-001');
}
}
}

findSpecificNameFromArray(single); // O(n) ----> Linear Time
1 change: 0 additions & 1 deletion section-big-o/sample-002.js

This file was deleted.