Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Dsa Bootcamp

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

DSA BOOTCAMP

Rutvika Patil

1
Input and Output

2
Input

The C functions scanf and printf are an alternative to the


C++ standard streams. They are usually a bit faster, but
they are also more difficult to use.
Output

Note: Newline "\n" works faster than endl.


Comparison

5
Comparing Floating Point Numbers

(ε = 10−9)
Shortening Code

7
Shortening Code: typedef
Shortening Code: Macros
Must Know

10
Know the Following
1. Summation Formulae
2. Logarithm Basics
3. Factorial
4. nCr and basic Probability
5. Set Theory
6. Time Complexity
7. Space Complexity
Time Complexity
Steps to master a DS
1.Pick up a Data Structure/ niche of problems. For eg: Array, Two pointers
2.Learn the fundamentals of that DS - how they are stored, implemented and
accessed, visualise + draw + learn.
3.But from where? Books, academics, Youtube
4.Pick up standard problems on arrays. For eg:
https://www.geeksforgeeks.org/array-data-structure/
5.Now try reading questions and solutions in your learnt language. Read the
explanation.
6.Try to solve the same question on your installed compiler/ online compiler /
leetcode / hackerrank.
7.Now after understanding the syntax and pattern, struggle with questions
without checking the solution.
8.Learn to read code and debug.
9.And yeah the trick to master?
10.CONTINUE THE PRACTICE!
Don't ignore the fundamentals.
Data Structures, variables, control structures, syntax, tools, time complexities or text editors.

Code On Paper
Master the Art of Testing Code
Create tricky test cases to find the bug.
Thumb Rules
★ Note the logic behind every new problem you solved.
★ Number of questions don’t matter when understanding is compromised
★ Keep a pen-notebook handy, know your logic on paper!
★ Read the solution if stuck, but make sure you write it yourself.
★ Watch YouTube videos.
★ Build problem-solving ability. Discuss.
★ Check editorials too. Improving your code counts!
Map

16
Map
Map

https://www.geeksforgeeks.org/map-associative-c
ontainers-the-c-standard-template-library-stl/
Iterator

19
advance() :- This function is used to increment the iterator position till the specified number
mentioned in its arguments.
next(), prev()
Array

22
Vector

24
https://www.geeksforgeeks.org/vector-in-cpp-stl/
Dynamic Programming Intro

26
DP
Dynamic Programming = Recursion + Memoization

Memoization: Stores already computed values in table (Memoization means

caching).

Optimal substructure: an optimal solution to a problem contains optimal solutions

to sub problems.

Overlapping sub problems: a recursive solution contains a small number of distinct

sub problems repeated many times.


Platforms

28
Platforms
Resources

30
Resources
1. Data Structures and Algorithms- Narsimha Karumachi
https://drive.google.com/file/d/1PkBdK5-AlfQaaTrSKFoiZ7bXUZoD1Enz/view?usp=sharing

2. Aditya Verma: https://www.youtube.com/channel/UC5WO7o71wvxMxEtLRkPhiQQ


3. https://binarysearch.com/learn
4. https://www.geeksforgeeks.org/lmns-algorithms-gq/
5. https://www.geeksforgeeks.org/last-minute-notes-operating-systems/
6. https://www.geeksforgeeks.org/last-minute-notes-dbms/
7. https://www.geeksforgeeks.org/last-minute-notes-computer-network/
ARRAYS:

Basic:

⮚ Reverse/rotate/ all sorts an array-without inbuilt


⮚ Fibonacci -all approaches
⮚ know vector/arraylist if possible
⮚ https://www.geeksforgeeks.org/minimum-lcm-and-gcd-possible-among-all-possible-sub-arrays/?ref=rp
⮚ https://practice.geeksforgeeks.org/problems/rotate-array-by-n-elements/0
Practice:
1) https://www.geeksforgeeks.org/product-of-all-subarrays-of-an-array/?ref=leftbar-rightbar
2) https://www.geeksforgeeks.org/print-the-maximum-subarray-sum/
3) https://www.geeksforgeeks.org/count-of-all-pairs-in-an-array-with-minimum-absolute-difference/
4) https://www.geeksforgeeks.org/maximum-sum-of-elements-divisible-by-k-from-the-given-array/?ref=leftbar-rightbar
5) Easy - https://leetcode.com/problems/remove-duplicates-from-sorted-array
6) Optimize- https://leetcode.com/problems/maximum-product-of-two-elements-in-an-array
7) https://leetcode.com/problems/max-consecutive-ones
8) Medium- https://leetcode.com/problems/find-the-duplicate-number
9) https://leetcode.com/problems/move-zeroes
10) https://leetcode.com/problems/two-sum
11) https://leetcode.com/problems/best-time-to-buy-and-sell-stock
PUZZLES

https://www.geeksforgeeks.org/puzzles/ --- do/read all of them in 90 mins max

EXTRA:

https://www.cut-the-knot.org/pigeonhole/TwoColorsInPlane.shtml#solution

https://gurmeet.net/puzzles/two-dice-nine-cards/index.html

https://www.geeksforgeeks.org/puzzle-5-finding-the-injection-for-anesthesia/

https://www.geeksforgeeks.org/puzzle-44-girl-or-boy/

https://www.geeksforgeeks.org/puzzle-43-muddy-heads/

https://puzzling.stackexchange.com/questions/186/whats-the-fewest-weights-you-need-to-balance-any-

weight-from-1-to-40-pounds

https://www.analyticsvidhya.com/blog/2016/07/20-challenging-job-interview-puzzles-which-every-analyst-

solve-atleast/
NOTE
Stop looking for perfect course, perfect mentor, one-time magical solution, perfect book.

Because there isn’t any!

Reading swimming tutorials won’t make you a swimmer, but jumping into the pool will surely

start the journey.

It is all about you and all the baby steps that count.

Be smart, know your resources and make most out of them!


“If you can’t fly then run,
If you can’t run then walk,
If you can’t walk then crawl,
But whatever you do, you have to keep moving forward.”

-Martin Luther King Jr.


Try out different
ways to do the
same problem
Contact me:
https://www.linkedin.com/in/rutvika/
Questions

37
THANK YOU

38

You might also like