Skip to content
Advertisement

Tag: data-structures

How do I read multiple CSV files to sort data in Java?

So, my Java project has two CSV files that needs to read and print some sort the data from high to low. First CSV file has date, location, new_cases, new_deaths, total_cases, total_deaths format. Second CSV file has Country, location, continent, population_year, population format. What I’m trying to do is to read both data, run a function to calculate continent data,

Can’t access my linked list methods and can’t iterate trough it

So im following along this playlist about data structures and in this video to conclude the linked list part, the professor explain we need an inner class called IteratorHelper. Video: https://www.youtube.com/watch?v=bx0ebSGUKto&list=PLpPXw4zFa0uKKhaSz87IowJnOTzh9tiBk&index=21 This is the code in my github with the linked list implementation and the main class called tester: https://github.com/Ghevi/Algos-DataStructures/tree/master/src/com/ghevi/ads/linkedlists The problem is that the tester class can’t compile. If

Java Staircase is printing in wrong direction (hackerrank)

This solution to the staircase prints the correct output, but in the opposite direction. Any idea how to alter this solution to get the desired result? Input: Expected output: Actual Output: It’s for a hackerrank easy challenge. I just want to be able to use my approach that I discovered instead of a solution I find online. Thanks! Answer You

Do arrays in Java store data or pointers

I was reading about data locality and want to use it to improve my game engine that I’m writing. Let’s say that I have created five objects at different times that are now all in different places in the memory not next to each other. If I add them all to an array, will that array only hold pointers to

Advertisement