-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7a7c0d
commit 0c061a4
Showing
15 changed files
with
415 additions
and
8,614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 4 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
node_modules | ||
/dist | ||
|
||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,56 @@ | ||
# my-app | ||
# Data Structures | ||
A data structure is a data organization, management, and storage format that enables efficient access and modification. | ||
|
||
## Project setup | ||
``` | ||
yarn install | ||
## Linked List | ||
``` | ||
// An instance of Linked List class | ||
const linkedList = new LinkedList(); | ||
### Compiles and hot-reloads for development | ||
``` | ||
yarn serve | ||
``` | ||
// append at the end of the Linked List | ||
linkedList.appendNodeToEnd("Apple"); | ||
linkedList.appendNodeToEnd("Banana"); | ||
linkedList.appendNodeToEnd("Banana"); | ||
linkedList.appendNodeToEnd("Banana"); | ||
linkedList.appendNodeToEnd("Orange"); | ||
linkedList.appendNodeToEnd("Potato"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Cherries"); | ||
### Compiles and minifies for production | ||
``` | ||
yarn build | ||
``` | ||
// prepend at the start of the Linked List | ||
linkedList.prependNodeToStart("Fruit"); | ||
### Lints and fixes files | ||
``` | ||
yarn lint | ||
// delete node from the Linked List | ||
linkedList.deleteNodeFromList("Fruit"); | ||
linkedList.deleteNodeFromList("Potato"); | ||
linkedList.deleteNodeFromList("Cherries"); | ||
// insert newNode after givenNode | ||
linkedList.insertNodeAfter("Insert: Eggs", "Grapes"); | ||
// output Linked List | ||
const allNodes = linkedList.toArray(); | ||
// find matching node or nodes in Linked List | ||
const singleMatchingNode = linkedList.findSingleMatchingNode("Grapes"); | ||
const allMatchingNodes = linkedList.findAllMatchingNodes("Grapes"); | ||
// find total count of all matching nodes | ||
const countAllMatchingNodes = linkedList.countOfAllMatchingNodes("Grapes"); | ||
// output | ||
console.log({ | ||
allNodes, | ||
singleMatchingNode, | ||
allMatchingNodes, | ||
countAllMatchingNodes, | ||
}); | ||
``` | ||
|
||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). | ||
## Binary Search | ||
todo | ||
|
||
## Linked List | ||
todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/cli-plugin-babel/preset' | ||
] | ||
presets: [ | ||
'@vue/cli-plugin-babel/preset' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,45 @@ | ||
{ | ||
"name": "my-app", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"lint": "vue-cli-service lint" | ||
}, | ||
"dependencies": { | ||
"core-js": "^3.6.5", | ||
"vue": "^2.6.11" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~4.5.0", | ||
"@vue/cli-plugin-eslint": "~4.5.0", | ||
"@vue/cli-service": "~4.5.0", | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^6.7.2", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"vue-template-compiler": "^2.6.11" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"plugin:vue/essential", | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"parser": "babel-eslint" | ||
}, | ||
"rules": {} | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"last 2 versions", | ||
"not dead" | ||
] | ||
"name": "data-structures", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"lint": "vue-cli-service lint" | ||
}, | ||
"dependencies": { | ||
"core-js": "^3.6.5", | ||
"node-sass": "^4.14.1", | ||
"vue": "^2.6.11" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~4.5.0", | ||
"@vue/cli-plugin-eslint": "~4.5.0", | ||
"@vue/cli-service": "~4.5.0", | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^6.7.2", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"sass": "^1.26.10", | ||
"sass-loader": "^9.0.3", | ||
"vue-template-compiler": "^2.6.11" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"plugin:vue/essential", | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"parser": "babel-eslint" | ||
}, | ||
"rules": {} | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"last 2 versions", | ||
"not dead" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
</head> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,17 @@ | ||
<template> | ||
<div id="app"> | ||
<img alt="Vue logo" src="./assets/logo.png"> | ||
<HelloWorld msg="Welcome to Your Vue.js App"/> | ||
</div> | ||
<div class="ds-data-structures"> | ||
<!-- Linked List --> | ||
<LinkedList /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import HelloWorld from './components/HelloWorld.vue' | ||
import LinkedList from "./components/linked-list/LinkedList.vue"; | ||
export default { | ||
name: 'App', | ||
components: { | ||
HelloWorld | ||
} | ||
} | ||
name: "App", | ||
components: { | ||
LinkedList | ||
} | ||
}; | ||
</script> | ||
|
||
<style> | ||
#app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
</style> |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<template> | ||
<div class="ds-linked-list"></div> | ||
</template> | ||
|
||
<script> | ||
import { LinkedList } from './../../implementation/LinkedList'; | ||
export default { | ||
name: "LinkedList", | ||
mounted: function () { | ||
// An instance of Linked List class | ||
const linkedList = new LinkedList(); | ||
// append at the end of the Linked List | ||
linkedList.appendNodeToEnd("Apple"); | ||
linkedList.appendNodeToEnd("Banana"); | ||
linkedList.appendNodeToEnd("Banana"); | ||
linkedList.appendNodeToEnd("Banana"); | ||
linkedList.appendNodeToEnd("Orange"); | ||
linkedList.appendNodeToEnd("Potato"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Grapes"); | ||
linkedList.appendNodeToEnd("Cherries"); | ||
// prepend at the start of the Linked List | ||
linkedList.prependNodeToStart("Fruit"); | ||
// delete node from the Linked List | ||
linkedList.deleteNodeFromList("Fruit"); | ||
linkedList.deleteNodeFromList("Potato"); | ||
linkedList.deleteNodeFromList("Cherries"); | ||
// insert newNode after givenNode | ||
linkedList.insertNodeAfter("Insert: Eggs", "Grapes"); | ||
// output Linked List | ||
const allNodes = linkedList.toArray(); | ||
// find matching node or nodes in Linked List | ||
const singleMatchingNode = linkedList.findSingleMatchingNode("Grapes"); | ||
const allMatchingNodes = linkedList.findAllMatchingNodes("Grapes"); | ||
// find total count of all matching nodes | ||
const countAllMatchingNodes = linkedList.countOfAllMatchingNodes("Grapes"); | ||
// output | ||
console.log({ | ||
allNodes, | ||
singleMatchingNode, | ||
allMatchingNodes, | ||
countAllMatchingNodes, | ||
}); | ||
}, | ||
}; | ||
</script> |
Empty file.
Oops, something went wrong.