/algorithms-java

Project to store algorithms in Java Language

Primary LanguageJavaMIT LicenseMIT

Algorithms in Java

Stack

StringUtils

  • Counting Duplicate Characters
  • Counting Duplicate Characters with Stream
  • Finding the first non-repeated character
  • Finding the first non-repeated character with LinkedHashMap
  • Reversing letters and words
  • Reversing letters and words (functional style)
  • Checking whether a string contains only digits
  • Counting vowels and consonants
  • Counting vowels and consonants (functional style)
  • Counting the occurrences of a certain character - Unicode surrogate
  • Counting the occurrences of a certain character (functional style)
  • Checking whether a string is a palindrome - "default" solution
  • Checking whether a string is a palindrome with StringBuilder
  • Checking whether a string is a palindrome (functional style)
  • Removing duplicate characters
  • Removing duplicate characters (functional style)
  • Removing a given character
  • Removing a given character (functional style)
  • Finding the character with the most appearances (functional Style)
  • Counting substring occurrences in a string first Approach (11 in 111 occurs 1 time)
  • Counting substring occurrences in a string second Approach (11 in 111 occurs 2 times)

NumberUtils

  • Sum of Integers
  • Sum of Integers with stream reduce
  • Count duplicate numbers

DateUtils

  • Get ZonedDateTime from LocalDateTime and ZoneId
  • Get the same time instant in another zone
  • Get Period of time between two LocalDates

Tree

Vector

Search

  • binarySearch

Exceptions

  • Check object and throws generic exception
  • Check object and throws generic exception using Supplier
├── main
│   └── java
│       └── dev
│           └── deyve
│               └── algorithmsjava
│                   ├── exceptions
│                   │   ├── Car.java
│                   │   └── Exceptions.java
│                   ├── search
│                   │   ├── BubbleSort.java
│                   │   └── Search.java
│                   ├── stacks
│                   │   └── Stack.java
│                   ├── streams
│                   │   ├── Streams.java
│                   │   └── User.java
│                   ├── trees
│                   │   ├── Node.java
│                   │   └── Tree.java
│                   ├── utils
│                   │   ├── DateUtils.java
│                   │   ├── NumberUtils.java
│                   │   └── StringUtils.java
│                   └── vectors
│                       └── Vector.java
└── test
    └── java
        └── dev
            └── deyve
                └── algorithmsjava
                    ├── exceptions
                    │   └── ExceptionsTest.java
                    ├── search
                    │   ├── BubbleSortTest.java
                    │   └── SearchTest.java
                    ├── stacks
                    │   └── StackTest.java
                    ├── streams
                    │   └── StreamsTest.java
                    ├── trees
                    │   └── TreeTest.java
                    ├── utils
                    │   ├── DateUtilsTest.java
                    │   ├── NumberUtilsTest.java
                    │   └── StringUtilsTest.java
                    └── vectors
                        └── VectorTest.java

24 directories, 23 files