All Questions
52,408 questions
0
votes
1
answer
55
views
understanding a part of recursion for a binary search tree
Hello I basically need to implement a recursive function for insertion of a binary tree. I already implemented the chunk of insertion function (wether it's largest or smaller than root) but there's an ...
-2
votes
0
answers
42
views
I keep getting a NullPointerException and I don’t know why [duplicate]
I’m trying to create a simple program where I have an array of Person objects. Each person has a name and age, and I’m trying to print out their names.
But I keep getting a NullPointerException and I ...
0
votes
1
answer
72
views
How to group anagrams using collections efficiently? [closed]
I'm working on a Java problem where I need to group words that are anagrams of each other. For instance, given the input array:
["eat", "tea", "tan", "ate", &...
3
votes
2
answers
155
views
How to retrieve individual arrays from arrays of strings stored inside an ArrayList?
I'm working on an assignment where I need to take "books" from the user(a title, an author, and ISBN number, all strings), and store these books somehow, and then do various things to these ...
-3
votes
4
answers
105
views
Needed Aid With Java Schoolwork - Containing Arrays & Array Searchs
Current Outputs:
Is [1, 2, 3] found in [1, 2, 1, 2, 3] ? >>> false
Is [1, 1, 3] found in [1, 2, 1, 2, 3] ? >>> false
Needed Outputs:
Is [1, 2, 3] found in [1, 2, 1, 2, 3]? >>&...
0
votes
1
answer
39
views
Loading a model but i get this error of bytes
private MappedByteBuffer loadModelFile() throws IOException {
AssetFileDescriptor fileDescriptor = getAssets().openFd("model1.tflite");
FileInputStream inputStream = new ...
2
votes
1
answer
66
views
How to Render the same model multiple times
I am trying to render the same 3D object dynamically. When I execute the method responsible for this, the 3D object is rendered on the screen only once. When I execute the method again, it gives me an ...
-3
votes
1
answer
157
views
How can I shuffle an array using a seeded randomiser?
I must prompt for a number range and seed, then create an array of 5 numbers per row that has 2 of each number within the given range, in ASCENDING order. Following this, the order should be shuffled ...
1
vote
1
answer
47
views
Im implementing a python dict. I´m using a doubly linked list, it works until the first resize. How can I change my resize method to make it work?
When inserting the first 8 pairs of keys and values it works perfectly fine and the order is maintained, the problem comes after the resizing. If I insert the pairs (4,4),(5,5),(6,6),(7,7),(1,1),(2,2),...
-1
votes
1
answer
41
views
NoSuchElementException and premature closure of scanner
I have made a program that reads 5 integers and outputs its polarity(positive or negative), its type(odd or even). Used Scanner.nextLine() to read the input as string and split it with .split("\s+...
4
votes
1
answer
105
views
Remove duplicate objects from JSON array in Java or Kotlin
I'm trying to figure out how to remove duplicate classInformation from schoolInformation if the below conditions are matched:
classInformation.teacherPercentage and classInformation.teachInfo.id are ...
-2
votes
3
answers
135
views
How is this sorting the array in Java during merge [closed]
I was just reviewing some merge sorting and finding that I'm missing how when merging it is storing the sorted arrays.
import java.util.Arrays;
public class MergeTwoArrays2 {
public static void ...
2
votes
3
answers
228
views
How to sort a list of object by two fields when the first field is a date but of string type and the second field is a plain string
I have an array of Object that I need sorted by two of the object's fields.
Product.java
private String productionDate;
private String productionCountry;
private String productDescription;
Now I ...
0
votes
3
answers
100
views
Convert integer array in double array [duplicate]
I need help debugging a Java matrix. I want to convert the integer array to a double array.
I have the matrix:
int matrix[][] = new int [10][10];
I suppose that there is a way to make the matrix of ...
0
votes
0
answers
42
views
Drools - Pulling an ArrayList<String> from a HashMap<String, Object> in drools
For the life of me I cannot pull a simple String ArrayList from my generic hashmap: HashMap<String, Object>
I have been able to pull much more complicated structures such as List of objects ...