Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

asdsyd/DSA-with-Kunal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA-with-Kunal

GitHub forks GitHub stars GitHub watchers GitHub contributors

Learn Fundamentals of Datastructres and Algorithms in Java with Kunal.

What is Java?

Java is a popular programming language first released by Sun Microsystems in 1995. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. It is owned by Oracle.

Let's get started

We have 8 primitive data types in Java:

  1. byte
  2. short
  3. int
  4. long
  5. float
  6. double
  7. boolean
  8. char

Non-primitive data types include

  1. String
  2. Arrays
  3. Classes

Arrays

Now let's look at Arrays!

Array in java is a group of like-typed variables referred to by a common name.

Creating and Initializing an Array :

  1. Using new operator
datatype[] nameOfArray = new datatype[sizeOfArray];

OR

datatype nameOfArray[] = new datatype[ sizeOfArray];

Example:

int[] myArray = new int[10];
  1. Shortcut syntax
datatype[] nameOfArray = {elt1, elt2, ... };

OR

datatype nameOfArray[] = {elt1, elt2, ... };

Example:

int[] myArray = {10,20,30,40};

💡 Note: Here the length of the array is determined by the number of values provided between braces and separated by commas.

Accessing an Array

  1. Using for loop
for (int i=0; i < nameOfArray.length; i++)
    System.out.println(nameOfArray[i]);
  1. Using for-each loop
for (datatype variable : Array)
    System.out.println(nameOfArray[i]);

Example:

for(int i : arr)
    System.out.println(arr[i]);
  1. Using Arrays.toString() method
System.out.println(Arrays.toString(nameOfArray));



Complete Java + DSA Bootcamp Syllabus

NOTE

  • All topics will contain problems from LeetCode Easy to Hard, explained in an easy-to-understand manner.
  • Complete custom implementation of all Data Structures and Algorithms.

Lectures

Advanced concepts apart from interviews

  • Fast IO
  • File handling
  • Bitwise + DP
  • Extended Euclidean algorithm
  • Modulo Multiplicative Inverse
  • Linear Diophantine Equations
  • Matrix Exponentiation
  • Mathematical Expectation
  • Catalan Numbers
  • Fermat’s Theorem
  • Wilson's Theorem
  • Euler's Theorem
  • Lucas Theorem
  • Chinese Remainder Theorem
  • Euler Totient
  • NP - Completeness
  • Multithreading
  • Fenwick Tree / Binary Indexed Tree
  • Square Root Decomposition