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 ...
6votes
2answers
260views
Goldbach conjecture solution finder
The Goldbach conjecture says: any even number greater than two can be represented by the sum of two prime numbers. G(n) = { (p1, p2) | p1 + p2 = n, p1 and p2 are prime numbers with p1 < p2 } For ...
6votes
2answers
624views
Add 1 to an integer represented as an array of digits
Problem Statement This is another LeetCode question I came across, where I need to add 1 to a number. The number is represented as an integer array where each index position is a digit and ...
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 ...
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 ...
3votes
1answer
81views
Data-type implementation for multiple dynamic histograms
This is almost exercise 3.2.14. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne (since I am self-studying, I changed it a little bit): Develop a version of ...
3votes
2answers
154views
Transcoding of a large histogram
I'm currently working on transcoding a large histogram so that the lessened file can be used within a viewer style GUI. The transcoding works by using Tokens to define runs of bins. For example, ...
2votes
1answer
150views
Decoding a histogram
I'm writing this as a follow-up for my previous question posted here: I've successfully decoded a large histogram into a byte array, which is written to a file. I'm now focusing on returning the byte ...
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 ...
9votes
1answer
1kviews
Generate unique random strings considering collisions
I'm coding a random strings generator. It's working, but I'm not sure if this is efficient. ...
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
3answers
9kviews
Printing longest sequence of zeroes
I am doing a coding exercise in codility and I came across this question: A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ...