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.
2
votes
4
answers
818
views
Generate all possible numbers which can be representated as the sum of 2 cubes below N
I have written a program that generates all possible numbers which can be represented by adding 2 cubes which have value less than N
For example: when \$N = 10, 1^3 + 2^3 = 9\$
import java.util.Arra …
2
votes
1
answer
12k
views
Max heap implementation
I have implemented a max-Heap data structure backed by an array. I wanted to know whether this is an acceptable implementation or not.
Any improvements or suggestions are welcome.
import java.util.A …
2
votes
2
answers
523
views
Trie structure with three classes
I have implemented a trie in Java and I would request you to review it and suggest improvements or new features.
The code is split into 3 files. …
3
votes
1
answer
429
views
All combinations of a string with special characters
I have written a function which generates combinations of string by replacing 1 or more characters by the symbol "*".
The code is as follows:
/**
this following code is responsible to genera …
3
votes
1
answer
4k
views
Sum of left and right nodes (individually) in a Binary Search Tree
I have written a program which calculates the sum of all the left nodes and the sum of right nodes in a Binary search tree.
I have used BFS to traverse the tree. The code is as follows:
import java. …
6
votes
1
answer
41k
views
Printing a tree level by level
I have written a program to print a binary tree level by level on different lines, like the tree would actually look if drawn on paper.
I have done a BFS traversal and then I proceed to print the tre …
3
votes
1
answer
2k
views
Reversing the lines of file
I have written a program to reverse the lines of a file. I made use of the String [] approach with the String.split(separator) using a custom separator.
import java.io.BufferedReader;
import java.io. …
2
votes
3
answers
5k
views
Edit distance between 2 strings
I have written a program that calculates the "cost" of transforming one string into another. I would like you to review it.
public class EditDistance {
public static void main(String[] args) {
…