DEV Community

BhargavMantha
BhargavMantha

Posted on

Linked List in TS

What are Linked Lists

  1. Linear dynamic Data Structure
  2. Expensive to maintain in comparison to arrays in terms of insertion and deletion
  3. comprises nodes
  4. last element points to null
  5. can grow and shrink on demand
  6. made of 2 items of data and reference to the next node

MAJOR DISADVANTAGE OF LINKED LIST - O(n) for access to an element in the worst case.

Basic Operations

  1. traverse linked list
  2. push
  3. pop
  4. insertAtFirst
  5. deleteByIndex

Top comments (0)