Learn Fundamentals of Datastructres and Algorithms in Java with Kunal.
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.
We have 8 primitive data types in Java:
byte
short
int
long
float
double
boolean
char
Non-primitive data types include
String
Arrays
Classes
Now let's look at Arrays!
Array in java is a group of like-typed variables referred to by a common name.
- Using new operator
datatype[] nameOfArray = new datatype[sizeOfArray];
OR
datatype nameOfArray[] = new datatype[ sizeOfArray];
Example:
int[] myArray = new int[10];
- 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.
- Using for loop
for (int i=0; i < nameOfArray.length; i++)
System.out.println(nameOfArray[i]);
- Using for-each loop
for (datatype variable : Array)
System.out.println(nameOfArray[i]);
Example:
for(int i : arr)
System.out.println(arr[i]);
- Using Arrays.toString() method
System.out.println(Arrays.toString(nameOfArray));
- 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.
-
Space and Time Complexity Analysis
- Introduction
- Comparisons of various cases
- Solving Linear Recurrence Relations
- Solving Divide and Conquer Recurrence Relations
- Big-O, Big-Omega, Big-Theta Notations
- Little Notations
- Get equation of any relation easily -best and easiest approach
- Complexity discussion of all the problems we do
- Space Complexity
- NP-Completeness Introduction
-
- Introduction
- Classes & its instances
- this keyword in Java
- Properties
- Overloading & Overriding
- Static & Non-Static
- Packages
- Access Control
- Interfaces
- com.asad.Abstract Classes
- Annotations
- Singleton Class
- final, finalize, finally
- Object Cloning
- Object Class
- Generics
- Exception Handling
- Collections Framework
- Vector Class
- Lambda Expression
- Enums
-
Linked List
-
Stacks & Queues
- Introduction
- Interview problems
- Push efficient
- Pop efficient
- Queue using Stack and Vice versa
- Circular Queue
-
Trees
- Introduction
- Binary Trees
- Binary Search Trees
- DFS
- BFS
- AVL Trees
- Segment Tree
-
Heaps
- Introduction
- Theory
- Priority Queue
- Heapsort
- Two Heaps Method
- k- way merge
- Top k elements
- Interval problems
-
HashMap
- Introduction
- Theory - how it works
- Comparisons of various forms
- Limitations and how to solve
- Map using LinkedList
- Map using Hash
- Count Sort
- Radix Sort
- Chaining
- Probing
- Huffman- Encoder
- Top K elements problems
-
Subarray Questions: Sliding window, Two Pointer, Kadane's Algorithm
-
Graphs
- Introduction
- BFS
- DFS
- Working with graph components
- Minimum Spanning Trees
- Kruskal Algorithm
- Prims Algorithm
- Dijkstra’s shortest path algorithm
- Topological Sort
- Bellman ford
- A* pathfinding Algorithm
-
Dynamic Programming
- Introduction
- Recursion + Recursion DP + Iteration + Iteration Space Optimized
- Complexity Analysis
- 0/1 Knapsack
- Subset Questions
- Unbounded Knapsack
- Subsequence questions
- String DP
-
Greedy Algorithms
-
Tries
- 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