diff --git a/outputFiles/appendListOutput1.txt b/outputFiles/appendListOutput1.txt index d0a40f7..cc00f1b 100644 --- a/outputFiles/appendListOutput1.txt +++ b/outputFiles/appendListOutput1.txt @@ -1,9 +1,17 @@ digraph List { rankdir=LR - 0 [label=1 fillcolor="" style=""] - 1 [label=2 fillcolor="" style=""] - 2 [label=3 fillcolor="" style=""] - 3 [label=4 fillcolor="" style=""] + 0 [label="[0] + +1" fillcolor="" style=""] + 1 [label="[1] + +2" fillcolor="" style=""] + 2 [label="[2] + +3" fillcolor="" style=""] + 3 [label="[3] + +4" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/appendListOutput2.txt b/outputFiles/appendListOutput2.txt index 60d3dfc..82c6922 100644 --- a/outputFiles/appendListOutput2.txt +++ b/outputFiles/appendListOutput2.txt @@ -1,10 +1,20 @@ digraph List { rankdir=LR - 0 [label=1 fillcolor="" style=""] - 1 [label=2 fillcolor="" style=""] - 2 [label=3 fillcolor="" style=""] - 3 [label=4 fillcolor="" style=""] - 4 [label=5 fillcolor=green style=filled] + 0 [label="[0] + +1" fillcolor="" style=""] + 1 [label="[1] + +2" fillcolor="" style=""] + 2 [label="[2] + +3" fillcolor="" style=""] + 3 [label="[3] + +4" fillcolor="" style=""] + 4 [label="[4] + +5" fillcolor=green style=filled] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/deleteListOutput1.txt b/outputFiles/deleteListOutput1.txt index d92b2c7..c57d00a 100644 --- a/outputFiles/deleteListOutput1.txt +++ b/outputFiles/deleteListOutput1.txt @@ -1,9 +1,17 @@ digraph List { rankdir=LR - 0 [label=1 fillcolor="" style=""] - 1 [label=2 fillcolor="" style=""] - 2 [label=3 fillcolor="" style=""] - 3 [label=3 fillcolor="" style=""] + 0 [label="[0] + +1" fillcolor="" style=""] + 1 [label="[1] + +2" fillcolor="" style=""] + 2 [label="[2] + +3" fillcolor="" style=""] + 3 [label="[3] + +3" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/deleteListOutput2.txt b/outputFiles/deleteListOutput2.txt index 2867917..476b959 100644 --- a/outputFiles/deleteListOutput2.txt +++ b/outputFiles/deleteListOutput2.txt @@ -1,8 +1,14 @@ digraph List { rankdir=LR - 0 [label=1 fillcolor="" style=""] - 1 [label=2 fillcolor="" style=""] - 2 [label=3 fillcolor="" style=""] + 0 [label="[0] + +1" fillcolor="" style=""] + 1 [label="[1] + +2" fillcolor="" style=""] + 2 [label="[2] + +3" fillcolor="" style=""] 0 -> 1 1 -> 2 } diff --git a/outputFiles/eg_appendlist_after.png b/outputFiles/eg_appendlist_after.png index 3d34cc1..1130336 100644 Binary files a/outputFiles/eg_appendlist_after.png and b/outputFiles/eg_appendlist_after.png differ diff --git a/outputFiles/eg_appendlist_before.png b/outputFiles/eg_appendlist_before.png index 6484c3d..952fced 100644 Binary files a/outputFiles/eg_appendlist_before.png and b/outputFiles/eg_appendlist_before.png differ diff --git a/outputFiles/initListOutput.txt b/outputFiles/initListOutput.txt index e947e94..197e70e 100644 --- a/outputFiles/initListOutput.txt +++ b/outputFiles/initListOutput.txt @@ -1,12 +1,26 @@ digraph List { rankdir=LR - 0 [label=2 fillcolor="" style=""] - 1 [label=4 fillcolor="" style=""] - 2 [label=6 fillcolor="" style=""] - 3 [label=8 fillcolor="" style=""] - 4 [label=10 fillcolor="" style=""] - 5 [label=12 fillcolor="" style=""] - 6 [label=14 fillcolor="" style=""] + 0 [label="[0] + +2" fillcolor="" style=""] + 1 [label="[1] + +4" fillcolor="" style=""] + 2 [label="[2] + +6" fillcolor="" style=""] + 3 [label="[3] + +8" fillcolor="" style=""] + 4 [label="[4] + +10" fillcolor="" style=""] + 5 [label="[5] + +12" fillcolor="" style=""] + 6 [label="[6] + +14" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/insertListOutput1.txt b/outputFiles/insertListOutput1.txt index c98a662..ea2efab 100644 --- a/outputFiles/insertListOutput1.txt +++ b/outputFiles/insertListOutput1.txt @@ -1,10 +1,20 @@ digraph List { rankdir=LR - 0 [label=100 fillcolor="" style=""] - 1 [label=200 fillcolor="" style=""] - 2 [label=400 fillcolor="" style=""] - 3 [label=500 fillcolor="" style=""] - 4 [label=600 fillcolor="" style=""] + 0 [label="[0] + +100" fillcolor="" style=""] + 1 [label="[1] + +200" fillcolor="" style=""] + 2 [label="[2] + +400" fillcolor="" style=""] + 3 [label="[3] + +500" fillcolor="" style=""] + 4 [label="[4] + +600" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/insertListOutput2.txt b/outputFiles/insertListOutput2.txt index fd4563d..22b2a46 100644 --- a/outputFiles/insertListOutput2.txt +++ b/outputFiles/insertListOutput2.txt @@ -1,11 +1,23 @@ digraph List { rankdir=LR - 0 [label=100 fillcolor="" style=""] - 1 [label=200 fillcolor="" style=""] - 2 [label=300 fillcolor=green style=filled] - 3 [label=400 fillcolor="" style=""] - 4 [label=500 fillcolor="" style=""] - 5 [label=600 fillcolor="" style=""] + 0 [label="[0] + +100" fillcolor="" style=""] + 1 [label="[1] + +200" fillcolor="" style=""] + 2 [label="[2] + +300" fillcolor=green style=filled] + 3 [label="[3] + +400" fillcolor="" style=""] + 4 [label="[4] + +500" fillcolor="" style=""] + 5 [label="[5] + +600" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/mixListOutput1.txt b/outputFiles/mixListOutput1.txt index fdf592b..16658c5 100644 --- a/outputFiles/mixListOutput1.txt +++ b/outputFiles/mixListOutput1.txt @@ -1,12 +1,26 @@ digraph List { rankdir=LR - 0 [label=3 fillcolor="" style=""] - 1 [label=53 fillcolor="" style=""] - 2 [label=98 fillcolor="" style=""] - 3 [label=2 fillcolor="" style=""] - 4 [label=35 fillcolor="" style=""] - 5 [label=46 fillcolor="" style=""] - 6 [label=1 fillcolor="" style=""] + 0 [label="[0] + +3" fillcolor="" style=""] + 1 [label="[1] + +53" fillcolor="" style=""] + 2 [label="[2] + +98" fillcolor="" style=""] + 3 [label="[3] + +2" fillcolor="" style=""] + 4 [label="[4] + +35" fillcolor="" style=""] + 5 [label="[5] + +46" fillcolor="" style=""] + 6 [label="[6] + +1" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/mixListOutput2.txt b/outputFiles/mixListOutput2.txt index 0fa66e4..c4cadcb 100644 --- a/outputFiles/mixListOutput2.txt +++ b/outputFiles/mixListOutput2.txt @@ -1,11 +1,23 @@ digraph List { rankdir=LR - 0 [label=3 fillcolor="" style=""] - 1 [label=53 fillcolor="" style=""] - 2 [label=98 fillcolor="" style=""] - 3 [label=35 fillcolor="" style=""] - 4 [label=46 fillcolor="" style=""] - 5 [label=1 fillcolor="" style=""] + 0 [label="[0] + +3" fillcolor="" style=""] + 1 [label="[1] + +53" fillcolor="" style=""] + 2 [label="[2] + +98" fillcolor="" style=""] + 3 [label="[3] + +35" fillcolor="" style=""] + 4 [label="[4] + +46" fillcolor="" style=""] + 5 [label="[5] + +1" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/mixListOutput3.txt b/outputFiles/mixListOutput3.txt index d69d9ba..f87d7a8 100644 --- a/outputFiles/mixListOutput3.txt +++ b/outputFiles/mixListOutput3.txt @@ -1,12 +1,26 @@ digraph List { rankdir=LR - 0 [label=3 fillcolor="" style=""] - 1 [label=53 fillcolor="" style=""] - 2 [label=98 fillcolor="" style=""] - 3 [label=35 fillcolor="" style=""] - 4 [label=46 fillcolor="" style=""] - 5 [label=1 fillcolor="" style=""] - 6 [label=-10 fillcolor=green style=filled] + 0 [label="[0] + +3" fillcolor="" style=""] + 1 [label="[1] + +53" fillcolor="" style=""] + 2 [label="[2] + +98" fillcolor="" style=""] + 3 [label="[3] + +35" fillcolor="" style=""] + 4 [label="[4] + +46" fillcolor="" style=""] + 5 [label="[5] + +1" fillcolor="" style=""] + 6 [label="[6] + +-10" fillcolor=green style=filled] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/mixListOutput4.txt b/outputFiles/mixListOutput4.txt index 025d169..73ae0c7 100644 --- a/outputFiles/mixListOutput4.txt +++ b/outputFiles/mixListOutput4.txt @@ -1,13 +1,29 @@ digraph List { rankdir=LR - 0 [label=0 fillcolor=green style=filled] - 1 [label=3 fillcolor="" style=""] - 2 [label=53 fillcolor="" style=""] - 3 [label=98 fillcolor="" style=""] - 4 [label=35 fillcolor="" style=""] - 5 [label=46 fillcolor="" style=""] - 6 [label=1 fillcolor="" style=""] - 7 [label=-10 fillcolor="" style=""] + 0 [label="[0] + +0" fillcolor=green style=filled] + 1 [label="[1] + +3" fillcolor="" style=""] + 2 [label="[2] + +53" fillcolor="" style=""] + 3 [label="[3] + +98" fillcolor="" style=""] + 4 [label="[4] + +35" fillcolor="" style=""] + 5 [label="[5] + +46" fillcolor="" style=""] + 6 [label="[6] + +1" fillcolor="" style=""] + 7 [label="[7] + +-10" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/mixListOutput5.txt b/outputFiles/mixListOutput5.txt index 47903d4..f4c7a28 100644 --- a/outputFiles/mixListOutput5.txt +++ b/outputFiles/mixListOutput5.txt @@ -1,13 +1,29 @@ digraph List { rankdir=LR - 0 [label=0 fillcolor="" style=""] - 1 [label=3 fillcolor="" style=""] - 2 [label=53 fillcolor="" style=""] - 3 [label=98 fillcolor="" style=""] - 4 [label=1000 fillcolor=green style=filled] - 5 [label=46 fillcolor="" style=""] - 6 [label=1 fillcolor="" style=""] - 7 [label=-10 fillcolor="" style=""] + 0 [label="[0] + +0" fillcolor="" style=""] + 1 [label="[1] + +3" fillcolor="" style=""] + 2 [label="[2] + +53" fillcolor="" style=""] + 3 [label="[3] + +98" fillcolor="" style=""] + 4 [label="[4] + +1000" fillcolor=green style=filled] + 5 [label="[5] + +46" fillcolor="" style=""] + 6 [label="[6] + +1" fillcolor="" style=""] + 7 [label="[7] + +-10" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/setListOutput1.txt b/outputFiles/setListOutput1.txt index 0ee4ef4..88aac35 100644 --- a/outputFiles/setListOutput1.txt +++ b/outputFiles/setListOutput1.txt @@ -1,9 +1,17 @@ digraph List { rankdir=LR - 0 [label=2 fillcolor="" style=""] - 1 [label=33 fillcolor="" style=""] - 2 [label=333 fillcolor="" style=""] - 3 [label=3333 fillcolor="" style=""] + 0 [label="[0] + +2" fillcolor="" style=""] + 1 [label="[1] + +33" fillcolor="" style=""] + 2 [label="[2] + +333" fillcolor="" style=""] + 3 [label="[3] + +3333" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/outputFiles/setListOutput2.txt b/outputFiles/setListOutput2.txt index 536763d..cf06b38 100644 --- a/outputFiles/setListOutput2.txt +++ b/outputFiles/setListOutput2.txt @@ -1,9 +1,17 @@ digraph List { rankdir=LR - 0 [label=3 fillcolor=green style=filled] - 1 [label=33 fillcolor="" style=""] - 2 [label=333 fillcolor="" style=""] - 3 [label=3333 fillcolor="" style=""] + 0 [label="[0] + +3" fillcolor=green style=filled] + 1 [label="[1] + +33" fillcolor="" style=""] + 2 [label="[2] + +333" fillcolor="" style=""] + 3 [label="[3] + +3333" fillcolor="" style=""] 0 -> 1 1 -> 2 2 -> 3 diff --git a/seealgo/see_list_algo.py b/seealgo/see_list_algo.py index aee5c31..45edf69 100644 --- a/seealgo/see_list_algo.py +++ b/seealgo/see_list_algo.py @@ -133,7 +133,8 @@ def create_viz(self, data, index): for i, val in enumerate(data): node_style = 'filled' if i == index else '' node_fillcolor = 'green' if i == index else '' - di_graph.node(str(i), label=str(val), style=node_style, fillcolor=node_fillcolor) + label = f"[{i}]\n\n{val}" + di_graph.node(str(i), label=label, style=node_style, fillcolor=node_fillcolor) # Create edges between adjacent nodes for i in range(len(data) - 1):