prakharmishra's blog

By prakharmishra, history, 9 months ago, In English

Hello Everyone,

  1. I found this C++ STL (standard template library) sheet online. Useful for someone starting out. Contains mostly everything about the basic data structures and how to implement them.
    Attaching link to pdf, Link

  2. Also attaching a small document I made, contains frequently used functions and tricks like finding MEX of array, nCr(combination), GCD, LCM, Seive, binary exponentiation for finding power etc.
    Attaching link to document, Link

Preview,


PS: Please suggest if you have more such functions or notice any errors and I'll fix them right away.
UPD: Added some questions in the document to practice.
UPD2: A list of most commonly asked DSA algorithms in interviews — Link

  • Vote: I like it
  • -2
  • Vote: I do not like it

»
9 months ago, hide # |
 
Vote: I like it -15 Vote: I do not like it

Apparently, posting something useful leads to downvotes

  • »
    »
    9 months ago, hide # ^ |
     
    Vote: I like it +2 Vote: I do not like it

    I can see the amount of work you put in, but the title should be C++ STL for BEGINNERSanyway, good work. Maybe consider compiling a standard list of bsearch/graph/DP problems it would be helpful.

    • »
      »
      »
      9 months ago, hide # ^ |
       
      Vote: I like it -6 Vote: I do not like it

      Thanks for the feedback! As for the problem list, I’ll try to compile one based on the problems I’ve come across on Codeforces.
      Meantime, if you require some standard questions for interviews, GFG already has a list of top-10 DSA algo's. I'll update it in the blog for now.

  • »
    »
    9 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    no brother some people are here for downvotes only they don't solve questions you keep sharing the knowledge we are listening

»
9 months ago, hide # |
 
Vote: I like it -6 Vote: I do not like it

Auto comment: topic has been updated by prakharmishra (previous revision, new revision, compare).

»
9 months ago, hide # |
Rev. 2  
Vote: I like it +11 Vote: I do not like it

This all seems pretty nice and useful (if it were posted on HackerRank, maybe). I went through all of it, and everything mentioned is either: 1. Trivial. 2. part of people's template code. 3. one Google search away. I felt like an LGM going through all of it xD. I'm 800 now (mentioning rating for when i look back at the good ol days xD)

  • »
    »
    9 months ago, hide # ^ |
     
    Vote: I like it -6 Vote: I do not like it

    I posted this for people who have started out as they don't know these stuff. It saves a lot of time. In a contest, searching for ways to find (say nCr) might take away precious time and also it happened to me that I was not able to find the most optimal way to do so when I started. Went through some blogs and submissions of red coders and compiled these.

  • »
    »
    9 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    HackerRank is beginner frinedly for problem solving?

»
9 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

Helpful

»
9 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

genuinely helpful kudos !!

»
9 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The first sheet would be useful, but:

  • It's very incomplete. Where is multiset, where is set::count or set::contains? What about creating a set/priority_queue with a different comparator?

  • It has mistakes, for example the time complexity of unordered_map::clear is O(n + number of buckets) not O(n).