Skip to content

Commit 9eecfcd

Browse files
authored
Merge pull request #43 from csvistool/dequeLLPseudocode
added LLdeque psuedocode and fix disjoint placement
2 parents 08cea7e + daf6aea commit 9eecfcd

3 files changed

Lines changed: 108 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
4141
<td align="center"><a href="https://github.com/zminot"><img src="https://avatars.githubusercontent.com/u/43081846?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zachary Minot</b></sub></a><br /><a href="https://github.com/csvistool/visualization-tool/commits?author=zminot" title="Code">💻</a></td>
4242
<td align="center"><a href="https://github.com/1ntEgr8"><img src="https://avatars.githubusercontent.com/u/40111357?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Elton Leander Pinto</b></sub></a><br /><a href="https://github.com/csvistool/visualization-tool/commits?author=1ntEgr8" title="Code">💻</a></td>
4343
<td align="center"><a href="https://github.com/yotam-k"><img src="https://avatars.githubusercontent.com/u/31946987?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yotam Kanny</b></sub></a><br /><a href="https://github.com/csvistool/visualization-tool/issues?q=author%3Ayotam-k" title="Bug reports">🐛</a> <a href="https://github.com/csvistool/visualization-tool/commits?author=yotam-k" title="Code">💻</a></td>
44-
<td align="center"><a href="https://github.com/ohcnivek"><img src="https://avatars.githubusercontent.com/u/64056046?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kevin Cho</b></sub></a><br /><a href="https://github.com/csvistool/visualization-tool/issues?q=author%3Aohcnivek" title="Bug reports">🐛</a> <a href="https://github.com/csvistool/visualization-tool/commits?author=ohcnivek" title="Code">💻</a></td>
44+
<td align="center"><a href="https://github.com/ohcnivek"><img src="https://avatars.githubusercontent.com/u/64056046?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kevin Cho</b></sub></a><br /><a href="https://github.com/csvistool/visualization-tool/issues?q=author%3Aohcnivek" title="Bug reports">🐛</a> <a href="https://github.com/csvistool/visualization-tool/commits?author=ohcnivek" title="Code"><💻/a></td>
4545
</tr>
4646
<tr>
4747
<td align="center"><a href="https://github.com/akoap"><img src="https://avatars.githubusercontent.com/u/35209362?v=4" width="100px;" alt=""/><br /><sub><b>Akshay Patil</b></sub></a><br /><a href="https://github.com/csvistool/visualization-tool/commits?author=akoap" title="Code">💻</a></td>
@@ -55,6 +55,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
5555
<td align="center"><a href="https://github.com/m-skaan"><img src="https://avatars.githubusercontent.com/u/93020882?v=4" width="100px;" alt=""/><br /><sub><b>Muskaan Gupta</b></sub></a><br /> <a href="https://github.com/csvistool/visualization-tool/commits?author=m-skaan" title="Code">💻</a></td>
5656
<td align="center"><a href="https://github.com/VineethSendilraj"><img src="https://avatars.githubusercontent.com/u/66220022?v=4" width="100px;" alt=""/><br /><sub><b>Vineeth Sendilraj</b></sub></a><br /> <a href="https://github.com/csvistool/visualization-tool/commits?author=VineethSendilraj" title="Code">💻</a> <a href="https://github.com/csvistool/visualization-tool/commits?author=VineethSendilraj" title="Design">🎨</a></td>
5757
<td align="center"><a href="https://github.com/PureTrippH"><img src="https://avatars.githubusercontent.com/u/20043396?v=4" width="100px;" alt=""/><br /><sub><b>Tripp Hanley</b></sub></a><br /> <a href="https://github.com/csvistool/visualization-tool/commits?author=PureTrippH" title="Code">💻</a></td>
58+
<td align="center"><a href="https://github.com/amchelapurath2023"><img src="https://avatars.githubusercontent.com/u/74162023?v=4" width="100px;" alt=""/><br /><sub><b>Anshul Chelapurath </b></sub></a><br /><a href="https://github.com/csvistool/visualization-tool/commits?author=amchelapurath2023" title="Code">💻</a></td>
5859
</tr>
5960
</table>
6061

src/AlgoList.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ export const algoList = [
104104
'Dijkstra',
105105
'Prim',
106106
'Kruskal',
107-
'DisjointSet',
108107
'LCS',
109108
'---',
110109
'DP & Extras',
111110
'CreateGraph',
111+
'DisjointSet',
112112
'SplayTree',
113113
'Floyd',
114114
'DropSort',
@@ -328,10 +328,6 @@ export const algoFilter = [
328328
id: 'Kruskal',
329329
category: 'Graph Algorithms',
330330
},
331-
{
332-
id: "DisjointSet",
333-
category: 'Graph Algorithms'
334-
},
335331
{
336332
id: 'LCS',
337333
category: 'DP & Extras',
@@ -344,6 +340,10 @@ export const algoFilter = [
344340
id: 'CreateGraph',
345341
category: 'DP & Extras',
346342
},
343+
{
344+
id: "DisjointSet",
345+
category: 'DP & Extras'
346+
},
347347
{
348348
id: 'SplayTree',
349349
category: 'DP & Extras',

src/pseudocode.json

Lines changed: 101 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -938,22 +938,115 @@
938938
},
939939
"DequeLL": {
940940
"addFirst": {
941-
"code": [],
942-
"english": []
941+
"code": [
942+
["procedure addFirst(data)"],
943+
[" if size == 0"],
944+
[" head ← new Node(data)"],
945+
[" tail ← head"],
946+
[" else"],
947+
[" Node newHead ← new Node(data)"],
948+
[" newHead.next ← head"],
949+
[" head.prev ← newHead"],
950+
[" head ← newHead"],
951+
[" size++"],
952+
["end procedure"]
953+
],
954+
"english": [
955+
["procedure addFirst(data)"],
956+
[" if (list is empty):"],
957+
[" head points to new node"],
958+
[" tail points to new node"],
959+
[" else:"],
960+
[" create newHead node with data"],
961+
[" newHead.next points to head"],
962+
[" head.prev points to newHead"],
963+
[" head points to newHead"],
964+
[" increment size"],
965+
["end procedure"]
966+
]
943967
},
944968
"addLast": {
945-
"code": [],
946-
"english": []
969+
"code": [
970+
["procedure addLast(data)"],
971+
[" if size == 0"],
972+
[" tail ← new Node(data)"],
973+
[" head ← tail"],
974+
[" else"],
975+
[" Node newTail ← new Node(data)"],
976+
[" newTail.prev ← tail"],
977+
[" tail.next ← newTail"],
978+
[" tail ← newTail"],
979+
[" size++"],
980+
["end procedure"]
981+
],
982+
"english": [
983+
["procedure addLast(data)"],
984+
[" if (list is empty):"],
985+
[" head points to new node"],
986+
[" tail points to new node"],
987+
[" else:"],
988+
[" create newTail node with data"],
989+
[" newTail.prev points to tail"],
990+
[" tail.next points to newTail"],
991+
[" tail points to newTail"],
992+
[" increment size"],
993+
["end procedure"]
994+
]
947995
},
948996
"removeFirst": {
949-
"code": [],
950-
"english": []
997+
"code": [
998+
["procedure removeFirst()"],
999+
[" T data ← head.data"],
1000+
[" head ← head.next"],
1001+
[" if head == null"],
1002+
[" tail ← null"],
1003+
[" else"],
1004+
[" head.prev ← null"],
1005+
[" size--"],
1006+
[" return data"],
1007+
["end procedure"]
1008+
],
1009+
"english": [
1010+
["procedure removeFirst()"],
1011+
[" copy data at head to temp"],
1012+
[" head moves to next node"],
1013+
[" if (head is null):"],
1014+
[" null out tail"],
1015+
[" else:"],
1016+
[" null out head.prev"],
1017+
[" decrement size"],
1018+
[" return temp"],
1019+
["end procedure"]
1020+
]
9511021
},
9521022
"removeLast": {
953-
"code": [],
954-
"english": []
1023+
"code": [
1024+
["procedure removeLast()"],
1025+
[" T data ← tail.data"],
1026+
[" tail ← tail.prev"],
1027+
[" if tail == null"],
1028+
[" head ← null"],
1029+
[" else"],
1030+
[" tail.next ← null"],
1031+
[" size--"],
1032+
[" return data"],
1033+
["end procedure"]
1034+
],
1035+
"english": [
1036+
["procedure removeBack()"],
1037+
[" copy data at tail to temp"],
1038+
[" tail moves to previous node"],
1039+
[" if (tail is null):"],
1040+
[" null out head"],
1041+
[" else:"],
1042+
[" null out tail.next"],
1043+
[" decrement size"],
1044+
[" return temp"],
1045+
["end procedure"]
1046+
]
9551047
}
9561048
},
1049+
9571050
"BST": {
9581051
"preorder": {
9591052
"code": [

0 commit comments

Comments
 (0)