Skip to content

thepalslab/algorithm-patterns-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Coding Patterns in Java

This repository organizes common coding patterns used to solve algorithmic problems efficiently.

Patterns Covered

  • Two Pointers
  • Sliding Window
  • Fast and Slow Pointers
  • Merge Intervals
  • Cyclic Sort
  • In-place Reversal of Linked List
  • Depth-First Search (DFS)
  • Breadth-First Search (BFS)
  • Topological Sort
  • Binary Search
  • Dynamic Programming
  • Backtracking
  • Bit Manipulation
  • Greedy
  • Subsets/Combinations/Permutations

πŸ“Œ Two Pointers

The Two Pointers pattern is used when dealing with sorted arrays or linked lists to find a pair, triplet, or subarray that meets certain criteria (e.g., sum, length, duplicates).

Common Use Cases:

  • Pair with target sum
  • Remove duplicates
  • Reverse an array in-place
  • Compare strings/arrays (anagram, palindrome)

Example Problems:

  • Reverse Array
  • Two Sum II – Input array is sorted
  • Remove Duplicates from Sorted Array
  • Is Subsequence

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages