Skip to content

arkajitb/DataStructures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Built-in Data Structures

  • List, Tuple, Dictionary, Set Lists are mutable(changable) a =[] a.append(stuff)

tuples are same as lists except it is not mutable c = (1,2,3)

dictionary : key-value pairs d = {} d['1'] = 2

Sets are a collection of unordered elements that are unique u can perform union, intersection etc on sets e = {2,3,4,5}

User Defined Data Structures

  • stack, Queue, Tree, LinkedList, Graph, Hashmaps

stack : Linear data structure (last in first out) push,pop,access from the top used in recursive programming, reversing words, undo mechanisms in word editors and so forth

queues : linear data structure (first in first out) operations can be performed from both ends of the queue(head-tail/front-back) the operation of adding and deleting element is called nqueue and dequeue used as network buffers for traffic conjestion management, job scheduling etc.

trees : non-linear data structures with roots and nodes. last nodes -> leaves. used in html pages, search operations etc.

linked list : linear data structures (image viewing application)

graphs : data collection of points containing vertices and edges used to find cost effective paths between nodes(google maps, uber uses graphs)

hashmaps: same as dictionaries in python

Algorithms

  • Divide and conquer
  • Dynamic programming
  • Greedy algorithms

Tree traversal

  • Pre-order
  • Post-order
  • In-order : Visit the left node->root->right node

Sorting algorithms

  • Merge sort : Follows the divide and conquer rule. The given list is first divided into smaller lists and compares adjacent lists and then reorders them in the desired sequence.

Time complexity

Binary search : Look at the middle element. It only works if the data is sorted.

Hash tables

Data lookup by key

In-place Array operations help to reduce space complexity

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages