All Questions
Tagged with javaperformance
1,272 questions
4votes
4answers
463views
Finding Special Parts in a Word
Task description: Imagine you have a long word made up of small letters like "a", "b", "c", ancd so on. Let’s call this word a puzzle word. We want to look at all the ...
4votes
2answers
110views
Custom RowSorter that sorts a Swing table containing data with unit suffixes
I would like to hear what you say about my custom RowSorter implementation. The following comparators should be used for the table columns: String, Double and Integer. The table data has postfixes and ...
6votes
7answers
1kviews
Filter non-even elements from an array
I have a method that returns an int[]. The array is made by filtering out only the even values of the array passed into the method. It works, but it's really ugly ...
3votes
1answer
122views
Multithreaded 8x8 grid 63-move path Pathfinding
This program primary effort is the pathfinding of an 8x8 grid without the use of Java Collection Framework. The starting cell is at the top left corner and the end is the bottom left corner. All valid ...
6votes
1answer
180views
Java BigInteger alternative for Arbitrarily Large Integers with Summation method
(This post has a continuation A Java class for representing big integers with arbitrary number of digits and summation method - take II.) Intro Now I have this rather simplistic ...
2votes
2answers
129views
A thread-safe performant Money Transfer API in Java
This is a popular interview question. It is meant to be done within 30 minutes. The task is to implement a thread-safe performant Bank Account API that allows to transfer, deposit, withdraw and check ...
3votes
1answer
237views
Leetcode: Number of Islands - BFS (Queue vs Recursion)
I was playing around with leetcode's Number of Islands. As per the challenge's description: Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the ...
6votes
1answer
135views
Creating random music covers using Conways Game of Life algorithm
(A sample cover art follows.) I'm currently working on replacing all the covers of my music files to have a unified theme, and I've started this project in Java to refresh my knowledge after a gap of ...
6votes
3answers
465views
Leetcode: Largest Number
I was trying out leetcode's Largest Number. As per the challenge's description: Given a list of non-negative integers nums, arrange them such that they form the largest number and return it. Since ...
4votes
2answers
513views
Leetcode: Steps to Make Array Non-decreasing
I was trying out leetcode's Steps to Make Array Non-decreasing As per the challenge's description: You are given a 0-indexed integer array nums. In one step, remove all elements nums[i] where nums[i ...
9votes
4answers
2kviews
Leetcode : First Missing Positive
I was trying out leetcode's first missing positive. As per the challenge's description: Given an unsorted integer array nums, return the smallest missing positive integer. You must implement an ...
1vote
1answer
423views
Inserting large number of rows into database with Spring boot
I need to insert many million rows + many GB of data into a database for a project that uses Spring boot. I recreated a minimal example with a one to many relationship and am trying to find the ...
6votes
3answers
712views
Program that brute forces to find the minimum dominating set
This program solves the minimum dominating set but it takes an insanely long time to run. In case you do not know, in graph theory, a dominating set for a graph G is a subset D of its vertices, such ...
4votes
2answers
429views
Map constructor utility class in Java 8
In a Java 8 project, I'm using several maps, many of which contain static or default content. In Java 9 and newer, there's the convenient Map.of() method and I want ...
2votes
4answers
183views
Comparison of two excel files ignoring line order
Below is a simple method which compares contents of two excel files ignoring the line order. This method is working as expected. But, one of my peers in their code review mentioned that initializing ...