Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and run-time environment (JRE). Java programs are compiled to bytecode and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.
3
votes
0
answers
146
views
Hashing and sliding window for string
I have implemented a solution for finding all anagrams. Are there any other suggestions for improving the solution?
package main.algorithms;
import java.util.ArrayList;
import java.util.List;
public …
5
votes
2
answers
183
views
Finding word count for a given string
I wrote a program to implement to find the count of words for a given string.
I have applied two different approaches.
The test works for these two approaches and I am looking for other approaches to …
3
votes
2
answers
111
views
First Unique Character in Java by frequency
I have completed an implementation for finding the first unique character.
Is there any way I can improve it?
package com.datastructures;
public class FirstUniqueCharacter {
public static void m …
4
votes
1
answer
194
views
Min Heap Java Implementation
I have implemented a min heap and looking for a simpler solution.
Is there anyone for suggesting a simpler solution for this?
Thanks.
import com.sun.org.apache.xalan.internal.xsltc.dom.MultiValuedN …
2
votes
1
answer
265
views
Circular Array - OOP
I have a solution for a circular array. How can I improve this?
package oopdesign.CircularArrayNes;
import java.util.Iterator;
import java.util.Spliterator;
import java.util.function.Consumer;
publ …
3
votes
0
answers
44
views
Optimizing the topological sorting
I have implemented the topological sort.
Is there any suggestion for optimizing the solution?
Thanks.
package src;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Stack;
cla …
5
votes
1
answer
365
views
Multithreaded Message Game
Use cases Messaging app between two users.
GameMain is for multithreading application refers to SendMessageWrokers.java
Only 2 user need to be defined and message app needs to finalize after a restr …
2
votes
2
answers
466
views
Cut Wood / Facebook Interview
This question was asked through the Facebook interview and the suggested solution is solving via binary search.
I have put the binary search solution but it still looks too complicated.
Question:
…
1
vote
2
answers
691
views
Roman Numeral Conversion in Java
I have designed this by using the stack data structure (similar to balanced parentheses problem) checking if the previous element is decreasing the number or not.
package test;
import main.algorithm …
0
votes
Cut Wood / Facebook Interview
I have added a getMaxValue() method to limit the search?
Could you please evaluate the solution if is it meets the limiting the search ?
Thanks.
package main.algorithms;
public class CutWood {
…
2
votes
1
answer
113
views
LRU Cache Example
Please check the following the LRU cache implementation.
Thanks for the valuable comments
import java.util.HashMap;
import java.util.Map;
public class LRUCache {
HashMap<Integer, Node> lruHash …
2
votes
1
answer
212
views
Producer-Consumer Semaphore Implementation
I have implemented a Producer-Consumer by Semaphore implementation.
I am looking forward to for your code review comments.
Thanks.
package ProducerConsumer.Semaphore;
import java.util.LinkedList;
imp …
4
votes
2
answers
83
views
Online Reader System Object Oriented System
I have designed and Online Book Reader System as considering the previous reviews on this platform. You can find the classes below. I would be appreciated for the valuable reviews.
Assumptions: "Onlin …
3
votes
2
answers
92
views
Largest Sum Contiguous Subarray - Kadene's algorithm
I am looking forward to an answer to improve this code?
Thanks.
Test class
package test;
import main.algorithms.LargestSumContiguousSubarray;
import org.junit.Assert;
import org.junit.Before;
import …
1
vote
1
answer
57
views
Is Array Separable To Two List
The aim of the implementation is divide an array to two sub array which the total of the every sub array should be equal. If Array is dividable then method return true else return false.
For example:
…