Questions tagged [java]

Programming questions are off-topic here. Do not ask questions about how to write code in Java. However, conceptual questions about computer science are more appropriate. See our help center for the scope of this site.

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
224 views

Are type constructors always injectives even in presence of quantified type variables (subtyping)?

Are type constructors, in a language that feature subtyping and quantification of type variables, like scala or Java, always injective? That is, is an equivalent of haskell ...
2
votes
0answers
690 views

How to visualize complex algorithm, like Split Array Largest Sum

I am trying to do the leetcode question I got the answer and trying to understand a systematical way to come up with the answer using the DP bottom-up approach, and I am having a hard time to ...
2
votes
0answers
159 views

Novel escape analysis algorithm for Java

Today I read a very interesting article about escape analysis in Java called Escape Analysis for Object Oriented Languages: Application to Java I think I have some grasp on how escape analysis works ...
1
vote
2answers
33 views

Can Yacc be used to generate three address code for Java 1?

I have read that yacc generates bottom up parser for LALR(1) grammars. I have a grammar for Java 1 that can be used for generating three address code and is strictly LALR(1), but the translation ...
1
vote
0answers
481 views

Time Complexity of Subset Problem

The Subset Exercise taken from LeetCode: ...
1
vote
0answers
46 views

What is the difference between self-rewriting program and program-with-updates-and-restart

I am reading about Goedel machine http://people.idsia.ch/~juergen/goedelmachine.html and especially the article about possible implementation (in the Scheme language) of this machine http://people....
1
vote
0answers
27 views

Nested Function stuck on iteration update

I want to solve the Sparse Extended Information Filter Slam described by Dr. Sebestian Thrun in Probabilistic Robotics.I stuck in some nested function. The algorithm is described in page 309 in this ...
1
vote
0answers
447 views

I'm looking for best algorithms to compare two Circular Linked List?

I'm looking for best algorithms to compare two Circular Linked List? For example : List 1 = 1-3-5 List 2 = 3-5-1 I want to compare "same" or "not same" but need fast algorithm.
1
vote
0answers
210 views

Is the Java 8 Grammar still a LALR(1) grammar?

As I found out here: http://www.eclipse.org/jdt/core/howto/generate%20parser/generateParser.html , the Java Version of 2005 (might be Java 6, I'm not sure) is a LALR(1) grammar. However, I couldn't ...
0
votes
0answers
7 views

Two different array of different array length having same elements. JAVA language

array a = {1,5,3} array b = {1,5,3,1,3,5,3,1} every elements in both the arrays are same and vice-versa . so "a" and "b" are set equal. this need to show only using for loops (JAVA)...
0
votes
0answers
49 views

What are the differences between the set of Real Numbers and the Java datatype float?

Besides the fact that the real numbers ℝ go on forever whereas the floats only go up to a certain point (Float.MAX_VALUE) in Java, what else could I compare between these two sets of numbers?
0
votes
0answers
8 views

What is the currently know fastest algorithms to convert each individual Java primitive and Number types to a Char Array/String

What is the currently know fastest algorithms to convert each individual Java primitive and Number types to a Char Array/String number representation while ...
0
votes
0answers
9 views

Blueprint for class and objects in Java

Good morning everybody. I would like to know if there is a blueprint I could refer to when creating classes and objects in Java? For instance, I was told for classes. You start VARIABLES DECLARATIONS ...
0
votes
0answers
12 views

How to remove filaments from a planar graph?

I have a planar graph and I'm trying to implement this algorithm (https://geometrictools.com/Documentation/MinimalCycleBasis.pdf Chapter 4, page 3). For the filament F0(V4, V3, V2), that has one ...
0
votes
1answer
42 views

How to draw the heap for an array in Java?

I have an assignment to draw the heap after an ArrayList and a LinkedList is created. ...
0
votes
0answers
15 views

Interval scheduling problem implementation

I am learning the Interval scheduling problem, and I came up after some reading with an implementation. I'll list my steps and the code, please let me know if this is correct or there is a more ...
0
votes
0answers
21 views

How to get synonyms from definitions using Bayes algorithm

I work on a project: an online dictionary where the user can find definitions of a word he's looking for. My supervisor asked us to add synonyms using machine learning. He recommend us to use Bayes ...
0
votes
0answers
26 views

Please explain the algorithm for finding bridges in graph?

let, low[] and disc[] be two 1D arrays disc[i] stores the discovery time of node[I] low[i] stores the lowest value between disc[i] and discovery time of children of node[i] I'm curious that what is ...
0
votes
2answers
57 views

Numerical Approximation in Java

I am trying to solve an equation which I believe cannot be done analytically, but can use a numerical approximation to get a result. The equation is: $$\frac{2*\sqrt{\pi}*h*s*e^{m^{2}/(2*s^2)}}{\sqrt{...
0
votes
0answers
109 views

Converting Turing machine into the source code in industrial programming language?

Are there methods how to convert Turing machine (e.g. neural Turing machine or other rigorous Turing machine) into the source code/program that is written in some industrial programming language like ...
0
votes
0answers
101 views

Given n strings, how to output their order after k phases of the radix sort (huge constraints)?

Disclaimer This is not from an ongoing contest, this is from my course of ITMO on edx.org, which is a paid code so I cannot give you a direct link to the course. Problem You are given $\...
0
votes
0answers
17 views

Without sound synthesis, what is a good way of making a program that plays guitar notes from an array of stored sounds?

Without sound synthesis, what is a good way of making a program that plays guitar notes from an array of stored sounds? What I have in mind is to make note as a function of vibration speed such as N (...
0
votes
0answers
309 views

Normal Distribution pattern in Java Array of doubles

Given ordered array of float numbers, Check if array represents Normal Distribution. I wrote algo to find triangular distribution as follows: ...
0
votes
1answer
1k views

How to write an EBNF grammar for Java float literals?

I've got this question on my study guide: "Write an EBNF grammar description for Java float literals and one for Java double literals." I've browsed the Oracle site and found the grammar for java ...
0
votes
2answers
58 views

Why does a RNN network output different based on the training sequence

I've set up an RNN LSTM network in Java using DL4J as the library. I currently have 500 examples of positive text, and 500 examples of negative text. When I fitness the training data by first ...
-1
votes
0answers
26 views

How should I decode the string?

I am working in an data entry application and it saves the data in a .db file with some sort of encoding. It has columns startdate, enddate, starttime, endtime, f1, f2 upto f15 and each column stores ...
-1
votes
1answer
450 views

Is there any way to find the nodes in the each subtree of each node having distance equal to height of the subtree?

We are given a tree of N nodes from 1 to N where node 1 is the root of the tree. For each node i from 1 to N, you have to find the numbers of nodes which are in the subtree of i and are at distance ...
-1
votes
1answer
34 views

Java programming object terminology

Say there is a class called Person. Then in the following expression : Person human = new Person() Which is the "reference&...