All Questions
35 questions
7
votes
3
answers
208
views
Euler - Largest Palindrome Product in Java
Having been going over the documentation, learning more of the subtleties of Java. I am now going over some basic Project-Euler solution code I wrote a little while back. Hoping I can pick up some ...
3
votes
1
answer
163
views
String Permutation Implemention
The objective is simple: List all possible permutations for a given a String. I looked at some implementations from popular sources. I decided to build this to the flow:
The Code for Review
...
2
votes
1
answer
360
views
Sorting visualizer using Java Swing
I programmed a little sorting visualizer a while back and I have been meaning to get some feedback on the overall implementation and on what I could do better to have cleaner code or a "best ...
3
votes
1
answer
153
views
Find potentional sponsor for every animal
This is a programming challenge in Czeck. My translation follows.
Does anyone know what the time complexity of my code is?
Input: The first line contains 2 integers: the number of animals 1 ≤N ≤100 ...
4
votes
1
answer
363
views
LeetCode 839: Similar String Groups II
I'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time!
Problem
Two strings X and Y are similar if we can swap two letters (in different positions) ...
3
votes
1
answer
287
views
LeetCode 146: LRU Cache III
I'm posting my Java code for LeetCode's LRU Cache. If you have time and would like to review, please do so. Thank you!
Problem
Design and implement a data structure for Least Recently Used (LRU) cache....
4
votes
1
answer
305
views
Minimax based Tic Tac Toe
I am attempting to make an unbeatable Tic Tac Toe game using a simplified minimax algorithm. The code looks like this:
...
2
votes
0
answers
813
views
LeetCode 218: The Skyline Problem II
Here I'm posting my Java code for the skyline problem. If you have time and would like to review, please do so, I'd appreciate that.
Problem
A city's skyline is the outer contour of the silhouette ...
3
votes
1
answer
475
views
LeetCode 767: Reorganize String
Here I'm posting my code for the Reorganize String problem on LeetCode. If you have time and would like to review, please do so, I'd appreciate that.
On LeetCode, we are only allowed to change the ...
1
vote
1
answer
182
views
LeetCode 76: Minimum Window Substring - Java
I'm posting my Java code for the Minimum Window Substring. If you have time and would like to review, please do so, I appreciate that.
Problem
Given a string string...
2
votes
2
answers
995
views
LeetCode 560: Subarray Sum Equals K - C++/Java
According to LeetCode, the following question is one of the most frequent interview questions asked by companies such as Facebook and Google. Here, I'm posting C++/Java codes, if you'd like to review, ...
5
votes
2
answers
520
views
How to optimize Karatsuba algorithm (using arraylist and java)
I was using Karatsuba algorithm to multiply two polynomials and return the coefficients and I am using java, we are asked to use arraylists here, however, my code is too complicated and it takes much ...
0
votes
1
answer
50
views
1
vote
2
answers
207
views
integer log base 10 function without using java.lang.Math?
I am assigned to a task of creating a function int logBase10Estimate(int n) that returns the log of a number base 10. The answer is integer part only.(w/o using the Math class)
Is this okay?
...
2
votes
1
answer
233
views
Priority queue with Max-Heap
I'm studying with book "Introduction to Algorithms" and implemented PriorityQueue without existed Class.
I made a MaxHeap class with Array and made a PriorityQueue with my Heap class.
Actually code ...