You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Add โ at index ๐ฅ | ๐โฎ๐ โ ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to push values from index `๐ฅ` to `๐ โ ๐ท`,<br> in order to make room for new value |
19
+
| Add โ as head | ๐โฎ๐โฏ | ๐โฎ๐ทโฏ | Need to push each and every values,<br> in order to make room for new head value |
20
+
| Add โ as tail | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ ||
21
+
| Remove โ index ๐ฅ | ๐โฎ๐ โ ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to move back values from `๐ฅ ๏นข ๐ท` index to tail value,<br> in order to fill the hole |
22
+
| Remove โ head | ๐โฎ๐โฏ | ๐โฎ๐ทโฏ | Need to move back each and every remaining values,<br> in order to fill the hole |
| Add โ at index ๐ฅ | ๐โฎ๐ โ ๐ฅโฏ (Amortized) | ๐โฎ๐ทโฏ | Need to push values from index `๐ฅ` to `๐ โ ๐ท`,<br> in order to make room for new value |
36
+
| Add โ as head | ๐โฎ๐โฏ | ๐โฎ๐ทโฏ | Need to push each and every values,<br> in order to make room for new head value |
| Remove โ index ๐ฅ | ๐โฎ๐ โ ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to move back values from `๐ฅ ๏นข ๐ท` index to tail value,<br> in order to fill the hole |
39
+
| Remove โ head | ๐โฎ๐โฏ | ๐โฎ๐ทโฏ | Need to move back each and every remaining values,<br> in order to fill the hole |
| Add โ at position `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ โ ๐ท`,<br> in order to retrieve node `๐ฅ โ ๐ท` and be able to link it to new node |
| Add โ **before** given node `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ โ ๐ท`,<br> in order to retrieve node `๐ฅ โ ๐ท` and be able to link it to new node |
51
+
| Add โ as head | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ ||
52
+
| Add โ as tail | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ | โ ๏ธ Assuming tail node is known !<br>Otherwise ๐โฎ๐โฏ, in order to retrieve current tail node |
53
+
| Remove โ at position `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ โ ๐ท`,<br> in order to be able to link node `๐ฅ โ ๐ท` to node `๐ฅ ๏นข ๐ท`|
54
+
| Remove โ given node `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ โ ๐ท`,<br> in order to be able to link node `๐ฅ โ ๐ท` to node `๐ฅ ๏นข ๐ท`|
55
+
| Remove โ head | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ ||
56
+
| Remove โ tail | ๐โฎ๐โฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node before tail node,<br> in order to unlink it from original tail node |
57
+
| Find node `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ`|
58
+
59
+
## Doubly linked list
60
+
โน๏ธ For a DLL of `๐` nodes, `๐ฅ` is the position of a given node in the list (from `๐ถ` to `๐ โ ๐ท`)
| Add โ at position `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ โ ๐ท`,<br> in order to retrieve node `๐ฅ โ ๐ท` and be able to link it to new node |
| Add โ as head | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ ||
68
+
| Add โ as tail | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ | โ ๏ธ Assuming tail node is known !<br>Otherwise ๐โฎ๐โฏ in order to retrieve original tail node |
69
+
| Remove โ at position `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ`,<br> in order to retrieve node `๐ฅ`|
70
+
| Remove โ given node `๐ฅ`| ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ ||
71
+
| Remove โ head | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ ||
72
+
| Remove โ tail | ๐โฎ๐ทโฏ | ๐โฎ๐ทโฏ | โ ๏ธ Assuming tail node is known !<br>Otherwise ๐โฎ๐โฏ, in order to retrieve node before tail node and unlink it from original tail node |
73
+
| Find node `๐ฅ`| ๐โฎ๐ฅโฏ | ๐โฎ๐ทโฏ | Need to iterate from head to node `๐ฅ`|
0 commit comments