Learning DSA 2

Learning DSA 2

Day 2: Quick Analysis of Time Complexity and Time constraints, Hashing in JAVA

The following image shows about the prediction of the Algorithms can be used based on the Time Constraints and that Mapping with the Time Complexity Analysis too. Hence, This a guided way of coding and the main important role comes with the Logic presentation on paper as the whole story of solving a problem,

  • up to 60% depends on the Logic building,

  • 20% on the syntax and code written

  • other 20% is on the Test cases.

Hence then, I headed out to solve some basic Loops Time Complexity Calculations. They are:

To have a back memory of the process of solving I added the following too.

That's all for the Day.
Self-Complementing me to doing them and also taunting to improve the speed of Learning.

Hashing Techniques and methods Review in JAVA

Here I mentioned about:

  • Hashcode importance and Generation

  • Hashing Technique

  • Collisions - Occurance, Problem & Solution

    Solution Types:

    1. Chaining - used for better Cache Performances

    2. Open Addressing - Less sensitive to Hash Functions

  • Hash Function

  • Probing Stratergies:

    1. Linear Probing: h(k,i) = ( h(k) + i ) % m

    2. Double Hashing: h(k,i) = ( h1(k) + h2(k) ) % m

Internal Working of HashMaps:

Kadane's Algorithm:( used for subArray )

If at any point of time sum becomes negative(<0) then it will further reduce sum, so no point of having max_sum subArray. So, append sum as '0' then it is called "Kadane's Algorithm".

source: My Short Notes :)