Skip to content

This project contains a good collection of Java programs for reference

Notifications You must be signed in to change notification settings

richardmr36/richard-java-programs

Repository files navigation

Programming Collections in Java

This project contains a good collection of Java programs with unit tests for reference.

Concurrency and Multithreading

  1. Atomic Counter
  2. Cyclic Barrier
  3. Blocking Queue Implementation - with and without Lock
  4. Executor Service - Single Thread and Fixed Thread Pool
  5. CountDownLatch
  6. Locks Implementation - Reentrant, Reentrant Read-write, Stamped
  7. ConcurrentHashMap
  8. Semaphore
  9. Thread APIs & ThreadLocal
  10. Concurrency Problems - Dining Philosophers, Producer Consumer

Data Structures and Algorithms

Arithmetic

  1. Armstrong Number
  2. Combination
  3. Disible by N
  4. Factorial
  5. Fibonacci
  6. Greatest Common Divisor
  7. Highest Power of 2 that is less than or equal to N
  8. Krishnamurthy Number
  9. Permutation
  10. Pronic Number
  11. Square Root Finder

Arrays

  1. Array Rotation
  2. Binary Heap Array
  3. Duplicate Number
  4. Frequency Counter
  5. Maximum Repeating Number
  6. Median of Sorted Arrays
  7. Minimum Swaps
  8. Missing Number
  9. Move Elements to end
  10. Next Greatest Element
  11. Odd Occurrence Element
  12. Pair with given sum
  13. Shuffle cards
  14. Sorted Squares
  15. Subarray Problems

Backtracking

  1. Coloring Problem
  2. Hamiltonian Path
  3. Knights Tour
  4. Maze Problem
  5. N Queens Problem
  6. Subset Sum
  7. Sudoku

Bit Manipulation

  1. Simple Algorithms using Bitwise Operators
  2. First Repeated character finder
  3. Lonely integer
  4. Unique character string checker

Caching

  1. LFU Cache Simulation
  2. LRU Cache Simulation

Cryptography

  1. Caesar Cipher

Dynamic Programming

  1. Cutting Rod Problem
  2. Edit Distance
  3. Egg Dropping Problem
  4. Knapsack Problem
  5. Longest Common Subsequence
  6. Longest Increasing Subsequence
  7. Staircase Problem

General

  1. Day Finder
  2. Palindrome Prime
  3. Prime Numbers
  4. Roman Numeral Finder
  5. Set Bits Counter

Geometric

  1. Clock Angle Finder
  2. Line Intersection
  3. Orientation
  4. Overlapping Rectangles
  5. Point inside Polygon checker
  6. Rectangle into Squares

Graphs

  1. Connected graph
  2. Farthest node finder
  3. Check for cycle
  4. Graph Traversal
  5. Minimum Spanning Tree
  6. Undirected graph

Hashing

  1. Majority Element

Heap

  1. Min Heap
  2. Max Heap

Linked List

  1. Cycle Detecter
  2. Duplicate remover
  3. Flatten Linked list
  4. Reverse Linked list
  5. Linked list subset
  6. Merge sort
  7. Delete middle node
  8. Singly Linked list Palindrome

Matrices

  1. Difference in Diagonals
  2. Find Island
  3. Find maximum length path

Memoization

  1. Coin Change Problem
  2. Staircase Problem

Pattern Searching

  1. Knuth Morris Pratt method
  2. Naive method

Queue

  1. Priority Queue Median Finder

Recursion

  1. Josephus Problem
  2. Staircase Problem
  3. Print String Permutation
  4. Tower of Hanoi Problem

Regex

  1. Remove duplicate words
  2. General regex
  3. IP Address
  4. XML tag matcher

Searching

  1. Binary Search
  2. Interpolation Search
  3. Linear Search
  4. Saddleback Search
  5. Sorted Rotated Array Search
  6. Ternary Search

Selection

  1. Find kth largest element
  2. Find kth smallest element
  3. Quick Select
  4. Secretary Problem

Sorting

  1. Bogo Sort
  2. Bubble Sort
  3. Bucket Sort
  4. Cocktail Shaker Sort
  5. Comb Sort
  6. Counting Sort
  7. Cycle Sort
  8. Gnome Sort
  9. Heap Sort
  10. Insertion Sort
  11. Merge Sort
  12. Pancake Sort
  13. Pigeon Hole Sort
  14. Quick Sort
  15. Radix Sort
  16. Selection Sort
  17. Shell Sort

About

This project contains a good collection of Java programs for reference

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages