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
Time complexity of DLL operations: getFirst, getLast, removeFirst, removeLast, addFirst, addLast, getSize, isEmpty : O(1)
the rest of methods: O(N)
We just put the conclusion here. After we learn React hooks: useEffect, useState and so on, we will revisit this.
Test your understanding of reference type and value type
Test your understanding of the structure of SLL or DLL
Improve your coding skill
Continue with previous dll.js code.
add the code: console.log(dll), and console.log(dll.__proto__)
2.1 try to run dll.js on the console (terminal on your computer/ node environment)
2.2 try to run dll.js on the browser (client environment)
Is there any difference in the output? How to explain it?
A prototype version of dll.js has been provided. Read the code.
Review:
getFirst,getLast,removeFirst,removeLast,addFirst,addLast,getSize,isEmpty:O(1)the rest of methods:
O(N)We just put the conclusion here. After we learn React hooks:
useEffect,useStateand so on, we will revisit this.linked-list: https://javascript.info/recursion#linked-listTODAY
1.1 function
combineTwoSingleLL1.2 function
combineTwoDoubleLL1.3 function
mergeThe code link is here: https://github.com/githubdudu/react-study-group/tree/master/day4.
You can git clone & git pull to practice them.
This is for:
Continue with previous
dll.jscode.add the code:
console.log(dll), andconsole.log(dll.__proto__)2.1 try to run
dll.json the console (terminal on your computer/ node environment)2.2 try to run
dll.json the browser (client environment)Is there any difference in the output? How to explain it?
A
prototypeversion ofdll.jshas been provided. Read the code.Read and study all these:
https://javascript.info/prototype-inheritance
https://javascript.info/function-prototype
https://javascript.info/native-prototypes
https://javascript.info/prototype-methods