From 7ce6fc993f27643f432406f03e61e37222271e93 Mon Sep 17 00:00:00 2001 From: keshav6O9 Date: Sat, 28 Oct 2023 13:18:42 +0530 Subject: [PATCH 1/2] added comment and element to array of bubble sort --- CONTRIBUTING.md | 1 + DSA/Arrays/BubbleSort.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd17a1f..32f4aa2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,6 +9,7 @@ We are happy to welcome all the contributions from anyone willing to improve thi - Enhancements in the exisiting code-snippets or Notes - More ideas are welcomed! +#drftgyhujiko # Submitting Contributions👩‍💻👨‍💻 Below you will find the process and workflow used to review and merge your changes. ## Step 0 : Find an issue diff --git a/DSA/Arrays/BubbleSort.js b/DSA/Arrays/BubbleSort.js index c37a9d6..7d18bec 100644 --- a/DSA/Arrays/BubbleSort.js +++ b/DSA/Arrays/BubbleSort.js @@ -18,7 +18,7 @@ console.log(arr); } -var arr = [234, 43, 55, 63, 5, 6, 235, 547]; +var arr = [234, 43, 55, 63, 5, 6, 235, 547,32423,343,34]; // call the function bblSort(arr); \ No newline at end of file From e7b406145860024d92685fb8babff26728cacbf9 Mon Sep 17 00:00:00 2001 From: keshav6O9 Date: Sat, 28 Oct 2023 15:46:31 +0530 Subject: [PATCH 2/2] added balanced parenthese problem in Miscelleneous of DSA --- DSA/Arrays/BubbleSort.js | 2 +- DSA/Miscelleneous/balancedparentesis | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 DSA/Miscelleneous/balancedparentesis diff --git a/DSA/Arrays/BubbleSort.js b/DSA/Arrays/BubbleSort.js index 7d18bec..f5093ef 100644 --- a/DSA/Arrays/BubbleSort.js +++ b/DSA/Arrays/BubbleSort.js @@ -15,7 +15,7 @@ } } } - console.log(arr); + console.log(arr); vishwaMehta30 } var arr = [234, 43, 55, 63, 5, 6, 235, 547,32423,343,34]; diff --git a/DSA/Miscelleneous/balancedparentesis b/DSA/Miscelleneous/balancedparentesis new file mode 100644 index 0000000..3953388 --- /dev/null +++ b/DSA/Miscelleneous/balancedparentesis @@ -0,0 +1,19 @@ + +let isBalanced = (input) => { + + let brackets = "[]{}()<>" + let stack = [] + + for(let bracket of input) { + let bracketsIndex = brackets.indexOf(bracket) + + // if bracket is an opening bracket + if(bracketsIndex % 2 === 0) { + // push the closing bracket onto the stack + stack.push(bracketsIndex + 1) + } else { + //do something + } + } + return true ? true : false +} \ No newline at end of file