Skip to content

habyaad/DSA-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DSA-library

Introduction

I would be learning data structures and algorithm properly and extensively in 2023(over its span).
During this learning spree:

  • Python programming language would be used as the major tool of implementation.
  • Each concept would be documented properly in here.

Data Structures

Linked list

An alternative to arrays(better off at times)

Features:

  • Insertion
    • Insert at the beginning
    • Insert at the end
    • Insert at index
    • Insert multiple values
  • Deletion
    • Delete by value
    • Delete by index
  • Existence -> bool
  • Get Existence index -> int
  • Length
  • Count of value
  • Print linked list

Doubly Linked list

Double linked list

Features:

  • Insertion
    • Insert at the beginning
    • Insert at the end
    • Insert at index
    • Insert multiple values
  • Deletion
    • Delete by value
    • Delete by index
  • Existence -> bool
  • Get Existence index -> int
  • Length(optimised O(1))
  • Count of value
  • Print linked list forward and backward

HashMap or HashTable

For storing key-value pair using a hash function

Features:

  • Insert key value pair
  • Retrieve value of key
  • Hash function
  • Ensure uniqueness of key
  • Resetting value of a key
  • check if key exists in hash table

Stack

Implemented using deque(double ended queue) in python. stack operates on the Last in First Out (LIFO) mode

Features:

  • get length
  • add to stack
  • pop last item from stack
  • return last item without popping(peek)
  • check if empty
  • print stack

Queue

Implemented using deque(double ended queue) in python. Queue operates on the First in First Out (FIFO) mode

Features:

  • get length
  • add to queue(enqueue)
  • pop first item from stack
  • return first item without popping(peek)
  • check if empty
  • print queue

Tree

A non-linear data structure, see it as your normal tree with root, branches and leaves.

Features:

  • get level of a tree node
  • print tree in designated format
  • add children(leaves) to a treenode(branch)

Binary Tree

A non-linear data structure, a special kind of tree in which a treenode(branch) can have a maximum of two chidren(leaves) in which the lesser data always falls to the left of the treenode and the greater data falls to the right of the treenode.

Features:

  • insertion operation
  • deletion operation (ask me about this)
  • sum of data in tree
  • get minimum and maximum data in tree
  • check existence of a data in the tree
  • Print tree
    • in order traversal
    • pre order traversal
    • post order traversal

Algorithms

Search

Linear search

Search for a number in an array, sorted or unsorted and returns the index, iterates all through to where the number exists

Time complexity

O(n)

Binary search

Search for a number in a sorted array, and returns the index, divides the array in halves until number is found where existing.

Time complexity

O(log n)

Learning Source

Code basics

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published