Skip to content

Day 4  #8

Description

@githubdudu

Review:

  1. 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.
  2. Some reading resource about the feature of linked-list : https://javascript.info/recursion#linked-list

TODAY

  1. Two function coding practices.
    1.1 function combineTwoSingleLL
    1.2 function combineTwoDoubleLL
    1.3 function merge
    The 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:

  • Test your understanding of reference type and value type
  • Test your understanding of the structure of SLL or DLL
  • Improve your coding skill
  1. 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?

  2. A prototype version of dll.js has been provided. Read the code.

  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions