Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 1.87 KB

read401-05.md

File metadata and controls

65 lines (41 loc) · 1.87 KB

Implementation: Linked Lists

Big O: Analysis of Algorithm Efficiency

is used to describe the efficiency of an algorithm or function,This efficiency is evaluated based on 2 factors:

  1. run time : the amount time to running algorithm
  2. space: The amount of memory resources a function uses to store data and instructions.

to analyzing big o we shoud consider 4 Key Areas for analysis:

  1. Input Size: he size of the parameter values that are read by the algorithm
  2. Units of Measurement: evaluate a function for Time and Space complexity

the Running Time:

  • The time in milliseconds from the start of a function execution until it ends
  • The number of operations that are executed
  • The number of “Basic Operations” that are executed In order to quantify Memory Space
  • The amount of space needed to hold the code for the algorithm.
  • space of input
  • space of outout
  • working space
  1. Orders of Growth
  2. Best Case, Worst Case, and Average Case

Linked Lists

What is a Linked List

A Linked List is a sequence of Nodes that are connected/linked to each other

The best way to approach a traversal is through the use of a while() loop

while(next != null):
------

Types of Linked list

  1. Singly Linked list.
  2. Doubly Linked list.
  3. Circular Linked list.
  4. Doubly Circular Linked list.

adding node to Linked List

Linear data structures

deferent between array and linked list is if i need to store array with 7 element it take 7 bytes, but linked list need just 1 bytes.

Growing a linked list