Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

Algorithms

> 编程语言
Open source

Solutions for some common algorithm problems written in Java.

2.8K stars0 likes0 views
WebsiteGitHub

About

Solutions for some common algorithm problems written in Java.

Algorithms

This repository contains my solution for common algorithms. I've created this repository to learn about algorithms and improve solutions to common computer science problems. I'll try to add more solutions if I have time. :)

Each solution has a Java program and is tested. Some problems contain multiple solutions with different implementations.

You can check the solution executing tests inside tests directory. Some problems were resolved using TDD.

Problems

Trees

  • Binary tree by level
  • Binary tree pre order
  • Binary tree in order
  • Binary tree post order
  • Are binary trees equals?
  • Is binary search tree
  • Binary tree depth
  • Lowest common ancestor
  • Sorted array to BST
  • AVL tree median
  • Path calculator
  • Path to every leaf
  • Is tree balanced
  • Generate list with nodes by level

Linked List

  • Reverse linked list
  • Remove duplicates
  • Find kth element
  • Delete list node
  • Partition list
  • Sum lists
  • PalindromeList
  • Get element in the middle of the list

Strings

  • Int to String
  • Remove comments from file
  • Reverse sentence
  • Contains
  • Simple regular expression
  • Dot regular expression
  • Asterisk regular expression
  • Unique chars
  • Reverse string
  • Compress string
  • Is rotation using substring

Binary Numbers and bits operators

  • Is binary number even?
  • Sum binary numbers
  • Count the number of bits equals to 1
  • Merge binary numbers
  • Count the number of different bits
  • Reverse binary number order
  • Reverse binary number

Math Operations

  • Square root
  • Divide using subtraction
  • Multiplication without multiply
  • Find sums
  • ScientificNotation
  • Vector scalar product
  • Subtract adding

Sequences

  • Fibonacci numbers
  • Factorial

Arrays

  • Merge sorted arrays
  • Split array in positive and negative numbers
  • Remove duplicated elements
  • Move zeros in array
  • Find longest consecutive sequence
  • Multiply array elements
  • Move elements to position
  • Replace spaces
  • Rotate matrix
  • Rewrite row and columns with zero
  • Find the missing number

Sorting Algorithms

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort

Misc

  • Anagrams
  • Palindromes
  • Are anagrams?
  • Constant complexity order stack
  • Hello world without semicolon
  • Autoboxing trick

Developed By

  • Pedro Vicente Gómez Sánchez - [email protected]

License

Copyright 2014 Pedro Vicente Gómez Sánchez

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言