reading-notes


Project maintained by mr-atta Hosted on GitHub Pages — Theme by mattgraham

Linked Lists 📁


Q:What is a Linked List?

you can Linked List with two ways “ Singly and Doubly”.

Singly

Singly

Traversal Big O

Adding a Node » like: Adding O(1)

  1. Singly
  2. Singly
  3. Singly

Adding a Node » like: Adding O(n)

  1. Singly
  2. Singly
  3. Singly
  4. Singly



What’s a Linked List, Anyway?

let’s look on: Linear data structures

Linear data structures

Memory management


A node only knows about what data it contains, and who its neighbor is.

the bath »> There is a single track that we can traverse the list in; we start at the head node, and traverse from the root until the last node, which will end at an empty null value.


first thing what even is Big O?

An O(1) function takes constant time, which is to say that it doesn’t matter how many elements we have, or how huge our input is: it’ll always take the same amount of time and memory to run our algorithm.

An O(n) function is linear, which means that as our input grows (from ten numbers, to ten thousand, to ten million), the space and time that we need to run that algorithm grows linearly.

Big O()


To list or not to list?

array vs linked list


📁


📁