0% found this document useful (0 votes)
1 views43 pages

Java Basics Revision

The document is a comprehensive Java basics revision guide aimed at helping individuals prepare for interviews and coding rounds. It covers essential topics such as program structure, data types, input/output, control structures, arrays, and common algorithms, along with their time complexities. The guide emphasizes understanding key concepts rather than memorizing the entire language, and it includes practical examples and coding snippets.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views43 pages

Java Basics Revision

The document is a comprehensive Java basics revision guide aimed at helping individuals prepare for interviews and coding rounds. It covers essential topics such as program structure, data types, input/output, control structures, arrays, and common algorithms, along with their time complexities. The guide emphasizes understanding key concepts rather than memorizing the entire language, and it includes practical examples and coding snippets.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

7/9/26, 5:20 PM Java Basics Revision

i am forgeting java basic syntax can you explaine


everything in java to memorixe me everything before last
movement

Yes. If you're preparing for interviews or coding rounds, don't try to memorize the entire
Java language in one day. Instead, memorize the 20% of Java that you'll use in 80% of
DSA problems.

Below is a last-minute Java revision sheet.

1. Basic Program Structure

import [Link].*;

public class Main {

public static void main(String[] args) {

[Link]("Hello World");

}
}

Remember:

public class Main


main method

code starts here

2. Printing

[Link]("Hello");

[Link]("Hello");

[Link] 1/43
7/9/26, 5:20 PM Java Basics Revision

Java
[Link]("%d %s",10,"Java");

Difference

print()
No new line

println()
Next line

printf()
Formatting

3. Variables

int age = 21;

double salary = 55000.5;

char grade = 'A';

boolean isPass = true;

String name = "Tejas";

Remember

Whole number → int

Decimal → double

One character → char

True False → boolean

Sentence → String

4. Data Types
Type Example

byte 100

short 1000

int 100000

[Link] 2/43
7/9/26, 5:20 PM Java Basics Revision

Type Example

long 100000L

float 10.5f

double 10.5

char 'A'

boolean true

String "Java"

5. Taking Input

Scanner sc = new Scanner([Link]);

int a = [Link]();

double b = [Link]();

String s = [Link]();

String line = [Link]();

char ch = [Link]().charAt(0);

Remember

next()

one word

nextLine()

whole sentence

6. Operators
Arithmetic

+
-
*

[Link] 3/43
7/9/26, 5:20 PM Java Basics Revision
/
%

Ja a
Comparison

==
!=
>
<
>=
<=

Logical

&&

||

7. If Else

if(a>b){

[Link]("A");

else{

[Link]("B");

Else If

if(a>90){

else if(a>80){

else{

[Link] 4/43
7/9/26, 5:20 PM Java Basics Revision

8. Switch

switch(day){

case 1:
[Link]("Mon");
break;

case 2:
[Link]("Tue");
break;

default:
[Link]("Invalid");

9. Loops
For

for(int i=0;i<5;i++){

[Link](i);

While

while(i<5){

i++;

Do While

do{

i++;

[Link] 5/43
7/9/26, 5:20 PM Java Basics Revision

}while(i<5);

10. Break Continue

break;
Java

Stops loop.

continue;
Java

Skips current iteration.

11. Arrays
Create

int[] arr = {1,2,3,4};


Java

OR

int[] arr = new int[5];


Java

Length

[Link]
Java

Access

arr[0]
Java

Loop

for(int i=0;i<[Link];i++){

[Link](arr[i]);
[Link] 6/43
7/9/26, 5:20 PM Java Basics Revision

Enhanced Loop

for(int x:arr){

[Link](x);

12. 2D Array

int[][] arr = {

{1,2},

{3,4}

};

Traversal

for(int i=0;i<[Link];i++){

for(int j=0;j<arr[i].length;j++){

[Link](arr[i][j]);

13. Strings
Create

String s = "Java";
Java

Length

[Link] 7/43
7/9/26, 5:20 PM Java Basics Revision

[Link]();
Java

Character

[Link](0);
Java

Substring

[Link](1,3);
Java

Compare

[Link]("Java");
Java

Contains

[Link]("av");
Java

Lower

[Link]();
Java

Upper

[Link]();
Java

Split

[Link](" ");
Java

Replace

[Link]("a","b");
Java

[Link] 8/43
7/9/26, 5:20 PM Java Basics Revision

14. StringBuilder
Instead of

s = s + "A";
Java

Use

StringBuilder sb = new StringBuilder();

[Link]("Hello");

[Link]("Java");

[Link]();

[Link](2);

[Link](1,"A");

[Link]();

15. Functions

public static int add(int a,int b){

return a+b;

Call

int ans = add(2,3);


Java

Void

public static void hello(){

[Link]("Hi");

[Link] 9/43
7/9/26, 5:20 PM Java Basics Revision

16. Math Class

[Link](a,b);

[Link](a,b);

[Link](-5);

[Link](25);

[Link](2,3);

[Link](2.3);

[Link](2.9);

[Link]();

17. ArrayList

ArrayList<Integer> list = new ArrayList<>();


Java

Add

[Link](10);
Java

Get

[Link](0);
Java

Set

[Link](0,100);
Java

Remove

[Link](0);
Java

Size

[Link] 10/43
7/9/26, 5:20 PM Java Basics Revision

[Link]();
Java

Loop

for(int x:list){

[Link](x);

18. HashSet

HashSet<Integer> set = new HashSet<>();

[Link](10);

[Link](10);

[Link](10);

No duplicates.

19. HashMap

HashMap<String,Integer> map = new HashMap<>();


Java

Put

[Link]("A",10);
Java

Get

[Link]("A");
Java

Contains

[Link] 11/43
7/9/26, 5:20 PM Java Basics Revision

[Link]("A");
Java

Loop

for(String key:[Link]()){

[Link](key+" "+[Link](key));

20. Sorting

[Link](arr);
Java

Reverse

[Link](arr);

for(int i=[Link]-1;i>=0;i--){

21. Character Methods

[Link](ch);

[Link](ch);

[Link](ch);

[Link](ch);

[Link](ch);

[Link](ch);

22. Type Casting


[Link] 12/43
7/9/26, 5:20 PM Java Basics Revision

int a = (int)10.5;
Java

Output

10

23. Exception

try{

catch(Exception e){

24. Common DSA Loops


Array

for(int i=0;i<[Link];i++)
Java

Reverse

for(int i=[Link]-1;i>=0;i--)
Java

String

for(int i=0;i<[Link]();i++)
Java

2D

for(int i=0;i<[Link];i++){

for(int j=0;j<mat[0].length;j++){

[Link] 13/43
7/9/26, 5:20 PM Java Basics Revision

25. Most Used Imports

import [Link].*;
Java

It includes:

Scanner

Arrays

ArrayList

HashMap

HashSet

Queue

LinkedList

Stack

PriorityQueue

Collections

26. Most Asked Collections in DSA

ArrayList<Integer> list = new ArrayList<>();

HashSet<Integer> set = new HashSet<>();

HashMap<Integer,Integer> map = new HashMap<>();

Stack<Integer> stack = new Stack<>();

Queue<Integer> q = new LinkedList<>();

PriorityQueue<Integer> pq = new PriorityQueue<>();

27. Priority Queue (Heap)


[Link] 14/43
7/9/26, 5:20 PM Java Basics Revision

Min Heap (default)

PriorityQueue<Integer> pq = new PriorityQueue<>();


Java

Max Heap

PriorityQueue<Integer> pq =
new PriorityQueue<>([Link]());
Java

28. Time Complexity to Remember


Operation Complexity

Array access O(1)

Linear Search O(n)

Binary Search O(log n)

HashMap get/put O(1) average

HashSet add O(1) average

Sorting O(n log n)

🚀 Interview Cheat Sheet (Memorize These)


[Link] → Array length (no parentheses)

[Link]() → String length


[Link]() → ArrayList size

[Link](key, value) → Add/update


[Link](key) → Retrieve value
[Link](x) → Check existence

[Link](arr) → Sort array


[Link](list) → Sort ArrayList
[Link](ch) → Check digit
[Link](ch) → Check alphabet

[Link](a, b) → Maximum
StringBuilder → Efficient string modifications
Enhanced for loop: for (int x : arr)

[Link] 15/43
7/9/26, 5:20 PM Java Basics Revision

Since you're interviewing soon, I also recommend practicing 25 easy-to-medium Java DSA
questions (arrays, strings, numbers, and patterns). Solving those after this revision will
reinforce the syntax much faster than trying to memorize it in isolation.

Sources

also a all type of sorting and searching algoritham with its


how it works advantage dis advantage and timecomplexity

For interviews and DSA, you should know how each algorithm works, when to use it, and
its time complexity. Interviewers often ask "Why did you choose this sorting algorithm?"
rather than just asking you to code it.

1. Bubble Sort
Idea
Compare two adjacent elements and swap if they are in the wrong order.

Example

5 3 4 1

5 3 -> swap
3 5 4 1

5 4 -> swap
3 4 5 1

5 1 -> swap
3 4 1 5

Largest element reached the end.

Repeat until sorted.

Code

public static void bubbleSort(int[] arr){

int n = [Link];

for(int i=0;i<n-1;i++){

for(int j=0;j<n-i-1;j++){

if(arr[j]>arr[j+1]){

[Link] 16/43
7/9/26, 5:20 PM Java Basics Revision

int temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;

Time Complexity
Case Complexity

Best O(n) (optimized version)

Average O(n²)

Worst O(n²)

Space

O(1)

Advantages
Easy
Stable
In-place

Disadvantages
Very slow
Not used in real projects

2. Selection Sort
Idea
Find the smallest element.

Swap it with first position.

Repeat.

Example

5 3 2 8

[Link] 17/43
7/9/26, 5:20 PM Java Basics Revision
Smallest =2

Swap

2 3 5 8

Code

public static void selectionSort(int[] arr){

int n=[Link];

for(int i=0;i<n-1;i++){

int min=i;

for(int j=i+1;j<n;j++){

if(arr[j]<arr[min])

min=j;

int temp=arr[min];
arr[min]=arr[i];
arr[i]=temp;

Complexity
Case Complexity

Best O(n²)

Average O(n²)

Worst O(n²)

Space

O(1)

Advantages
Less swaps
Simple

Disadvantages
[Link] 18/43
7/9/26, 5:20 PM Java Basics Revision

Slow

3. Insertion Sort
Idea
Works like arranging playing cards.

Take one element.

Insert into correct position.

Example

5 3 4

Take 3

3 5

Take 4

3 4 5

Code

public static void insertionSort(int[] arr){

for(int i=1;i<[Link];i++){

int key=arr[i];

int j=i-1;

while(j>=0 && arr[j]>key){

arr[j+1]=arr[j];
j--;

arr[j+1]=key;

Complexity

[Link] 19/43
7/9/26, 5:20 PM Java Basics Revision

Case Complexity

Best O(n)

Average O(n²)

Worst O(n²)

Advantages
Fast for small arrays
Stable
Used in hybrid sorts

Disadvantages
Slow for large data

4. Merge Sort
Idea
Divide

Sort Left

Sort Right

Merge

Example

8 4 6 2

8 4

6 2

[Link] 20/43
7/9/26, 5:20 PM Java Basics Revision

4 8

2 6

2 4 6 8

Complexity
Case Complexity

Best O(n log n)

Average O(n log n)

Worst O(n log n)

Space

O(n)

Advantages
Very fast
Stable
Guaranteed O(n log n)

Disadvantages
Extra memory

5. Quick Sort
Idea
Choose Pivot

Move smaller left

Move larger right

Repeat

Example

7 2 5 1 9

Pivot =7

[Link] 21/43
7/9/26, 5:20 PM Java Basics Revision

2 5 1

Complexity
Case Complexity

Best O(n log n)

Average O(n log n)

Worst O(n²)

Space

O(log n)

Advantages
Very fast
In-place
Used in practice

Disadvantages
Worst case O(n²)
Not stable

6. Heap Sort
Idea
Build Max Heap

Largest element comes to top

Swap with last

Repeat

Complexity
Case Complexity

Best O(n log n)

[Link] 22/43
7/9/26, 5:20 PM Java Basics Revision

Case Complexity

Average O(n log n)

Worst O(n log n)

Space

O(1)

Advantages
No extra array
Guaranteed O(n log n)

Disadvantages
Slower than Quick Sort in practice
Not stable

7. Counting Sort
Idea
Count frequency.

Example

4 2 2 1

Count

1→1

2→2

4→1

Output

1 2 2 4

Complexity

O(n+k)

k = maximum value

Advantages
Extremely fast for small integer ranges

[Link] 23/43
7/9/26, 5:20 PM Java Basics Revision

Disadvantages
Only integers
Large memory if values are huge

8. Radix Sort
Idea
Sort digit by digit.

329

457

657

839

436

720

355

Sort by

Units

Tens

Hundreds

Complexity

O(d(n+k))

Advantages
Faster than comparison sorts for fixed-size integers

Disadvantages
Integer/string only
More complex

9. Bucket Sort
[Link] 24/43
7/9/26, 5:20 PM Java Basics Revision

Idea
Divide numbers into buckets.

Sort each bucket.

Combine.

Complexity
Average

O(n)

Worst

O(n²)

SEARCHING

1. Linear Search
Idea
Check every element.

1 4 6 7 8

Find 7

7 Found

Code

[Link] 25/43
7/9/26, 5:20 PM Java Basics Revision
for(int i=0;i<[Link];i++){

if(arr[i]==target)

return i;

Complexity
Case Complexity

Best O(1)

Average O(n)

Worst O(n)

Advantages
Works on unsorted arrays
Very simple

Disadvantages
Slow

2. Binary Search
Condition
Array must be sorted.

Idea
Take middle.

Equal?

Yes

Done

Else

Search left/right.

Example

1 3 5 7 9

Find 7

Middle
[Link] 26/43
7/9/26, 5:20 PM Java Basics Revision

7>5

Search Right

7 Found

Code

int left=0;

int right=[Link]-1;

while(left<=right){

int mid=(left+right)/2;

if(arr[mid]==target)

return mid;

else if(arr[mid]<target)

left=mid+1;

else

right=mid-1;

Complexity
Case Complexity

Best O(1)

Average O(log n)

Worst O(log n)

Advantages
Extremely fast
Used everywhere

Disadvantages
Array must be sorted

[Link] 27/43
7/9/26, 5:20 PM Java Basics Revision

3. Jump Search
Idea
Jump √n steps.

Then perform linear search.

Complexity

O(√n)

4. Interpolation Search
Idea
Instead of middle

Estimate where target should be.

Works only for uniformly distributed sorted data.

Complexity

Average

O(log log n)

Worst

O(n)

5. Exponential Search
Idea
Find range using powers of 2.

16

32

[Link] 28/43
7/9/26, 5:20 PM Java Basics Revision

Then Binary Search.

Complexity

O(log n)

Which Sorting Algorithm Should You Use?


Algorithm Best Average Worst Space Stable Use Case

Bubble O(n) O(n²) O(n²) O(1) ✅ Learning only

Selection O(n²) O(n²) O(n²) O(1) ❌ Few swaps n

Insertion O(n) O(n²) O(n²) O(1) ✅ Small or nea


arrays

Merge O(n log n) O(n log n) O(n log n) O(n) ✅ Large datase
lists, stable s

Quick O(n log n) O(n log n) O(n²) O(log n) ❌ General-purp


average case

Heap O(n log n) O(n log n) O(n log n) O(1) ❌ Memory-con


environment

Counting O(n+k) O(n+k) O(n+k) O(k) ✅ Small-range

Radix O(d(n+k)) O(d(n+k)) O(d(n+k)) O(n+k) ✅ Integers or fi


strings

Bucket O(n) O(n) O(n²) O(n) Depends Uniformly dis


data

 

Which Searching Algorithm Should You Use?


Algorithm Sorted Required? Time Complexity Use Case

Linear Search ❌ O(n) Small or unsorted arrays

Binary Search ✅ O(log n) Large sorted arrays

Jump Search ✅ O(√n) Sorted arrays with


sequential access

[Link] 29/43
7/9/26, 5:20 PM Java Basics Revision

Algorithm Sorted Required? Time Complexity Use Case

Interpolation Search ✅ Average O(log log n) Uniformly distributed


sorted numbers

Exponential Search ✅ O(log n) Very large or unbounded


sorted arrays

⭐ Interview Tip (Very Important)


For most Java DSA interviews (including coding platforms like LeetCode, HackerRank, and
interviews at service companies), you should be very comfortable with:
Searching: Linear Search, Binary Search
Sorting: Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort
Java built-in sorting: [Link]() and [Link]()
Concepts: Time complexity (Big O), space complexity, stability, in-place sorting, and
when to choose one algorithm over another.

Mastering these covers the vast majority of interview questions on sorting and searching.

some simple methods use in coding to solve dsa


questione like sliding window give more tips and trick to
solve problems

If you want to get good at DSA interviews, don't memorize hundreds of questions. Instead,
learn the common problem-solving patterns. Most LeetCode, HackerRank, TCS, Infosys,
Accenture, Capgemini, Cognizant, and product-company questions are variations of these
patterns.

1. Brute Force
Idea
Try every possible solution.

Example

Find pair whose sum = 10

1 4 6 5

Try

1+4

[Link] 30/43
7/9/26, 5:20 PM Java Basics Revision

1+6

1+5

4+6

4+5

6+5

Complexity

Usually O(n²)

Use when
Small input
First approach before optimization

2. Two Pointers ⭐⭐⭐⭐⭐


Most common interview pattern.

When to use
Sorted array
Reverse traversal
Remove duplicates
Pair Sum

Example

1 2 3 5 7 8

Target = 10

L R

1+8

Too small

Move Left

2+8

10

Found

[Link] 31/43
7/9/26, 5:20 PM Java Basics Revision

Problems
Two Sum (sorted)
Remove Duplicates
Reverse String
Container With Most Water
Valid Palindrome

Complexity

O(n)

3. Sliding Window ⭐⭐⭐⭐⭐


Instead of recalculating every window.

Move one step.

Remove left.

Add right.

Example

Maximum sum of size 3

1 2 3 4 5

Window

1 2 3 =6

2 3 4 =9

3 4 5 =12

Instead of

1+2+3

Again

2+3+4

Again

3+4+5

Problems
[Link] 32/43
7/9/26, 5:20 PM Java Basics Revision

Maximum Sum Subarray


Longest Substring
Fruits Into Basket
Longest Ones
Minimum Window

Complexity

O(n)

4. Prefix Sum ⭐⭐⭐⭐⭐


Store cumulative sum.

Example

1 2 3 4 5

Prefix

10

15

Want sum

index 2 to 4

15-3=12

Instead of looping again.

Problems

Range Sum Query


Subarray Sum
Equal Sum

Complexity

Preprocessing O(n)

Query O(1)

[Link] 33/43
7/9/26, 5:20 PM Java Basics Revision

5. HashMap ⭐⭐⭐⭐⭐
Whenever interviewer says

Find frequency

Find duplicates

Find first unique

Think

HashMap
Java

Example

Apple

Banana

Apple

Store

Apple→2

Banana→1

Problems
Two Sum
Frequency Count
Majority Element
Anagram
Longest Consecutive Sequence

Complexity

O(1)

average lookup

6. HashSet
Need uniqueness?

Think

[Link] 34/43
7/9/26, 5:20 PM Java Basics Revision
HashSet
Java

Problems
Remove duplicates
Contains duplicate
Longest Consecutive

7. Fast and Slow Pointer ⭐⭐⭐⭐⭐


Used in Linked List.

Example

Slow

1 step

Fast

2 steps

If fast meets slow

Cycle exists.

Problems

Detect Cycle
Middle Node
Happy Number

Complexity

O(n)

8. Binary Search ⭐⭐⭐⭐⭐


Question contains

Sorted

Minimum

Maximum

Search

Think Binary Search.

Complexity
[Link] 35/43
7/9/26, 5:20 PM Java Basics Revision

O(log n)

Problems
Search Insert
First Occurrence
Last Occurrence
Peak Element

9. Binary Search on Answer


Very common.

Question

Minimum speed

Minimum capacity

Maximum distance

Don't search element.

Search answer.

Example

Koko Eating Banana

Speed

...

100

Binary search on speed.

10. Recursion
Function calls itself.

Example

Factorial

[Link] 36/43
7/9/26, 5:20 PM Java Basics Revision

5!

5×4!

4×3!

3×2!

2×1

Problems
Tree
Backtracking
DFS

11. Backtracking ⭐⭐⭐⭐⭐


Try

Explore

Undo

Try next

Example

Maze

Sudoku

N Queen

Permutation

Subset

Think

[Link] 37/43
7/9/26, 5:20 PM Java Basics Revision

Choose

Explore

Backtrack

12. Dynamic Programming (DP)


Golden Rule

Repeated subproblems

Store answer

Reuse

Example

Fibonacci

Instead of

fib(5)

fib(4)

fib(3)

Again fib(3)

Again fib(2)

Store answers.

Problems

Climbing Stairs
House Robber
Coin Change
[Link] 38/43
7/9/26, 5:20 PM Java Basics Revision

Knapsack

13. Greedy
Always choose best now.

Hope future stays best.

Problems

Activity Selection
Jump Game
Gas Station

14. Monotonic Stack ⭐⭐⭐⭐⭐


Stack always increasing or decreasing.

Problems

Next Greater Element


Daily Temperatures
Largest Rectangle
Stock Span

15. Queue / BFS


Level by level.

Problems

Tree Level Order


Shortest Path
Rotten Oranges

16. DFS
Go deep.

Then return.

Problems

Graph
Tree
Island

[Link] 39/43
7/9/26, 5:20 PM Java Basics Revision

Flood Fill

17. Union Find (Disjoint Set)


Need

Connected Components

Cycle Detection

Network

18. Heap (Priority Queue)


Need

Smallest

Largest

Top K

Think

PriorityQueue
Java

Problems
K Largest
Merge K Lists
Median

19. Merge Intervals


Sort

Merge overlaps

Problems

Merge Interval

Insert Interval

[Link] 40/43
7/9/26, 5:20 PM Java Basics Revision

20. Bit Manipulation


Used for

Odd Even

Power of Two

Single Number

Example

Odd Even

if((n&1)==0)
Java

Swap

a=a^b;

b=a^b;

a=a^b;

How to Identify the Pattern


If the question says... Think...

Pair in sorted array Two Pointers

Longest/Shortest subarray or substring Sliding Window

Frequency / Count / Duplicate HashMap

Unique elements HashSet

Range Sum Prefix Sum

Sorted array search Binary Search

Minimum/Maximum possible answer Binary Search on Answer

Top K / Smallest / Largest Heap (PriorityQueue)

Level order BFS

Tree traversal DFS

[Link] 41/43
7/9/26, 5:20 PM Java Basics Revision

If the question says... Think...

Permutations / Combinations Backtracking

Overlapping intervals Merge Intervals

Repeated calculations Dynamic Programming

Next Greater / Previous Smaller Monotonic Stack

Connected components Union Find

General DSA Tips & Tricks


1. Always clarify the input
Is the array sorted?
Are duplicates allowed?
Can numbers be negative?
Is the input size ( n ) large?

2. Choose the right complexity


n ≤ 100 → O(n²) may be acceptable.

n ≈ 10⁵ → Aim for O(n log n) or O(n).


n ≈ 10⁶ → Usually O(n) is required.

3. Think in this order


1. Brute Force
2. Optimize with a pattern (HashMap, Two Pointers, Sliding Window, etc.)
3. Analyze time and space complexity.

4. Dry-run with a small example


Before coding, test your logic on a tiny input like [1, 2, 3] or "abc" to catch mistakes.

5. Watch for edge cases


Empty array/string
Single element
All elements the same
Already sorted
Target not found

A Simple Decision Tree

Is the array sorted?



Yes ─────► Binary Search / Two Pointers

No

[Link] 42/43
7/9/26, 5:20 PM Java Basics Revision
Need frequency/count?

Yes ─────► HashMap / HashSet

No

Longest/Shortest subarray or substring?

Yes ─────► Sliding Window

No

Range sum queries?

Yes ─────► Prefix Sum

No

Top K / Largest / Smallest?

Yes ─────► Heap (PriorityQueue)

No

Tree or Graph?

DFS / BFS

The 10 patterns to master first


If you're preparing for interviews, focus on these in order:
1. Arrays & Strings
2. HashMap / HashSet
3. Two Pointers
4. Sliding Window
5. Binary Search
6. Prefix Sum
7. Stack & Queue
8. Linked List
9. Trees (DFS & BFS)
10. Dynamic Programming (basics)

Mastering these patterns will help you solve a large percentage of common DSA interview
questions, because many problems are just different applications of the same underlying
ideas.

[Link] 43/43

You might also like