1
vote
4answers
280 views

How to work around Java's lack of pointers to pointers when working with linked data structures?

I've learned from a textbook how to implement binary search trees recursively in Java, and am working on implementing them nonrecursively. I've found a simple and elegant way to implement an insert ...
-2
votes
1answer
137 views

What is the largest size a HashSet or TreeSet be? [closed]

So I am working on a solo project that involves a lot of strings. In one of my smaller test cases there will be at least 70 million elements. So my question is, what is the largest possible size a ...
0
votes
3answers
172 views

Nested maps vs. combined keys

in the project I am currently working on we had three different types of prices depending on the age of the user (adult, child, etc...). So we had on the DB a table looking like this: PRICES type ...
2
votes
5answers
377 views

how to design a stack without using java library or using list [closed]

I have a question how to design a stack without using list or array? This is one question that I want to think about as I want to better understand stack.
40
votes
6answers
4k views

How necessary is it to follow defensive programming practices for code that will never be made publicly available?

I'm writing a Java implementation of a card game, so I created a special type of Collection I'm calling a Zone. All modification methods of Java's Collection are unsupported, but there's a method in ...
22
votes
2answers
752 views

Is there a data structure for this type of list/map?

Perhaps there's a name for what I want, but I'm not aware of it. I need something similar to a LinkedHashMap in Java, but where it returns the 'previous' value if there's no value at the specified ...
-1
votes
2answers
460 views

Importance of data structures in modern S/W development [closed]

During 1990s when there were no advanced frameworks/paradigms available for S/W development , knowledge on data structures was critical... which I can comprehend. But nowadays, for most of the ...
3
votes
2answers
689 views

Collection interfaces in C#, coming from Java

In Java, I'm used to declaring collections using the most-abstract interface possible and then constructing them using the concrete implementation that makes sense at the time. It usually looks ...
5
votes
2answers
2k views

Optimal way to store 18 billion key, value pairs [closed]

I have around 200 million new objects coming in, and a 90 day retention policy, so that leaves me with 18 billion records to be stored in the form of key-value pairs. Key and value both will be a ...
1
vote
0answers
184 views

Single write, multiple read of stateful objects

Scenario: One data input feed (call this Source) Multiple objects (call these Layer1) read this Source, and analyze the feed. This analysis is stateful. Layer1 objects have configuration parameters. ...
1
vote
2answers
363 views

Shift bytes through a fixed sized buffer

I'm writing an InputStream that processes data streams containing "trailer" data. That is, the final n bytes of the stream is a piece of data that must be handled separately and shouldn't be returned ...
-2
votes
2answers
261 views

About Artificial Intelligence [closed]

I am interested in starting a career in artificial intelligence. Can anyone suggest how I could prepare for this? What languages should I study that would be best for this career choice?
2
votes
4answers
307 views

Plugin Architecture: How to Handle Databases and Logging?

I am in the process of designing an architecture for a plugin based application and I have some questions about how to handle database access and logging. The goal of my application is to allow a ...
1
vote
2answers
5k views

How to increase the efficiency of an Immutable Queue in java?

I have been developing an Immutable queue in java, but the version I have developed is supposedly slow and I have been suggested to create a faster version of the same and I have no idea as to how to ...
2
votes
2answers
704 views

Thoughts on a custom data structure for a node/chain implementation

I am designing a simple GUI that will allow a user to create a GPX route by clicking repeatedly on a map panel. I am faced with a design dilemma for how to represent the nodes and route. This ...
2
votes
1answer
224 views

2D grid with multiple types of objects

This is my first post here in programmers.stackexchange (I'm a regular on SO). I hope this isn't too general. I'm trying a simple project to learn Java from something I've seen done in the past. ...
9
votes
4answers
2k views

Analyzing Memory Usage: Java vs C++ Negligible?

How does the memory usage of an integer object written in Java compare\contrast with the memory usage of a integer object written in C++? Is the difference negligible? No difference? A big difference? ...
1
vote
5answers
1k views

What Java data structure/design pattern best models this object, considering it would perform these methods?

Methods: 1. getDistance(CityA,CityB) // Returns distance between two cities 2. getCitiesInRadius(CityA,integer) // Returns cities within a given distance of another city 3. ...
9
votes
5answers
5k views

Real world usage of DelayQueue

What would be a real world usage of DelayQueue, what common problem it was designed to solve?
2
votes
2answers
405 views

How would you transfer data between your data structures and databases?

I'm learning programming in school and I have this question that's bugging me about data structures and transferring the information stored inside them to databases. We're doing just small systems - ...
6
votes
4answers
251 views

Is there a pattern that will help with this data structure

I'm doing a java project. My main structure contains 2 lists with elements of type A the other type B. B itself contains a list of objects which may contain elements of A. It must be that when an ...
4
votes
2answers
2k views

Is there a way to handle nested Collections more elegantly?

My question is rather a design question. In my program I got to a data structure that looks something like this: private ConcurrentHashMap<A, ConcurrentHashMap<B, ConcurrentHashMap<Integer, ...
3
votes
5answers
872 views

How do you cope with Java coming from javascript?

I learned some javascript as my introduction into programming, and now I'm trying to move on to Java and Python and from there to c++, c#, etc. I've been caught up with schoolwork, so I've had very ...
3
votes
3answers
469 views

Avoiding wrapper objects in collections

I'm getting a little annoyed of having to wrap primitive types in wrapper objects to store them in collection data structures (sets, maps, lists, etc.) in languages like Java and Objective C. I'd ...
2
votes
1answer
915 views

graph data structure in Java (or Python)

does Java have graphs as an intergrated data structure? How about Python? I was assigned to write a program, that solves the TSP (travelling salesman problem) via the GRASP (greedy randomized ...
20
votes
4answers
3k views

Which algorithms and data structures should a developer absolutely know?

I want to be a successful enterprise Java developer. With what algorithms and data structures should I be well versed? What books would you recommend to me? To be a successful Java developer, do I ...