Coder Social home page Coder Social logo

data-structure-and-algorithm's Introduction

Data structure in python

fenwick tree

basic image for the fenwick tree

  • image for the how data is stored in different index

fenwick tree

more solved problem on fenwick tree

  1. problem1.py - See problem here

set operation

  1. intersection => set1.intersection(set2) or set1 & set2
  2. union => set1.union(set2) or set1 | set2
  3. difference => set1.difference(set2) or H - R
  4. symmetric difference => set1.symmetric_difference(set2) or set1 ^ set2
  5. update => set1.update(set2) or set1 |= set2
  6. intersection_update => set1.intersection_update(set2) or set1 &= set2
  7. difference_update => set1.difference_update(set2) or set1 -= set2
  8. symmetric_difference_update => set1.symmetric_difference_update(set2) or set1 ^= set2
  9. issubset : set1 <= set2 => True=> set1 subset of set2

itertools

  1. permutations of size r => from itertools import permutations => permutations(iterable, size)
  2. combinations of size r => from itertools import combinations => combinations(iterable, size)
  3. combinations_with_replacement

python calendar module

  1. import calendar.. :) one of the coolest moodule...

python regex module

  1. import re ..=> cool module to deal with strings and substrings

python html parser module

  1. from html.parser import HTMLParser => shit ass parser to parse HTML

python fraction module

  1. from fractions import Fraction => supercool module to deal with Fractions and arithmetic..

set methods:

  1. pop, remove, discard..

numpy module

import numpy as np ==> axis = 0 => column, axis = 1 => row

  1. numpy.sum ---> axis = 0,1,None
  2. numpy.prod ---> ""
  3. numpy.min---> ""
  4. numpy.max ---> ""
  5. numpy.mean-->""
  6. numpy.var--> ""
  7. numpy.std--> ""
  8. numpy.dot --> matrix product
  9. numpy.cross --> cross product
  10. numpy.inner
  11. numpy.outer
  12. numpy.poly
  13. numpy.roots
  14. numpy.polyint
  15. numpy.polyval
  16. numpy.polyder
  17. numpy.polyfit
  18. numpy.linalg.det
  19. numpy.linalg.eig--> eigen value and eigen vector
  20. numpy.linalg.inv--> multiplicative inverse

Factorial

you can find the great article about it at here

Hackerrank problem links (video link : https://youtu.be/GwVDCi8CCAI)

  1. Sherlock and permutation : great problem on modular arithmetic Here and article is Here
  2. Recursive Sequence : Problem on SPOJ

data-structure-and-algorithm's People

Contributors

saurabh10041998 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.