From 5352dfdcda55b06ca2ec152fed19e1c9708ad4ef Mon Sep 17 00:00:00 2001 From: Wakidur Rahaman Date: Mon, 26 Sep 2022 14:11:20 +0900 Subject: [PATCH 1/3] add o-n first --- section-big-o/o-n-001.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 section-big-o/o-n-001.js diff --git a/section-big-o/o-n-001.js b/section-big-o/o-n-001.js new file mode 100644 index 0000000..ba91b97 --- /dev/null +++ b/section-big-o/o-n-001.js @@ -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 \ No newline at end of file From 870aed12b5cf0f31939be55f7fb40a04523663ad Mon Sep 17 00:00:00 2001 From: Wakidur Rahaman Date: Mon, 26 Sep 2022 14:12:32 +0900 Subject: [PATCH 2/3] dalate file --- section-big-o/sample-002.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 section-big-o/sample-002.js diff --git a/section-big-o/sample-002.js b/section-big-o/sample-002.js deleted file mode 100644 index 94037a3..0000000 --- a/section-big-o/sample-002.js +++ /dev/null @@ -1 +0,0 @@ -// Hello world \ No newline at end of file From b7e919f9589d10272113b7880c4fd7e9d78d602f Mon Sep 17 00:00:00 2001 From: Wakidur Rahaman Date: Mon, 26 Sep 2022 16:19:24 +0900 Subject: [PATCH 3/3] update readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8132b18..edd4cc6 100644 --- a/README.md +++ b/README.md @@ -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: