All Questions
Tagged with collections algorithm
13 questions
2
votes
1
answer
144
views
Print the App Name Using Latest Version
I am trying to solve a problem, where we are given an app name, service name, and version number of an api. We need to print the name of app, which is using the latest version for most of the service.
...
8
votes
3
answers
3k
views
Moving elements satisfying a predicate from one container to another
I've implemented a C++ algorithm that moves elements satisfying a given unary predicate from one container into the other, deleting them from the input container.
This is my implementation:
...
5
votes
2
answers
436
views
Find maximum value of Point represented by an Array of values for each coordinate
Suppose there is an array A = {3,2,5}, then points for this array correspond to indexes (i,j) where ...
1
vote
3
answers
152
views
Diffing two lists of business objects
dataListOne and dataListTwo will be full of BO objects (around 4000 - 5000).
Lets say ...
6
votes
3
answers
9k
views
Find a prefix of a query string in the values of a Map
I have a hash map which maps to some strings which serve as prefixes and are of small length (max length is 6):
...
6
votes
1
answer
1k
views
Efficient top k words using MultiMap (Google Guava ext lib JAR)
Basic algorithm:
Open document/huge text file
Use Map and List to separate the words. \$O(K)\$ time complexity (TC) considering ...
11
votes
4
answers
6k
views
Collection with both Set and List interface
Here's something I wrote a while ago. I needed a collection that was ordered, but also guaranteed duplicates did not occur. So I made a class with both Set and List interfaces. It seems to work ...
8
votes
1
answer
116
views
Joining collections... because it's fun
I'm working on a LinqEnumerable class (reviewable here), and I'm no Big-O expert and I'm pretty bad with algorithms, so I wonder what the complexity is for what I'...
5
votes
3
answers
486
views
Finding the closest value in a collection in a game-server plugin implementation
I have an array of a instances of an enum type. A random double variable is initialized with a value between 0.... to 1, and should be used to get the closest value'...
10
votes
3
answers
821
views
More imitation of Enumerable in VBA
I was inspired by Me How's question to see how far I could push an imitation of .Net's Enumerable Class.
The new functions can obviously handle Collections, but can also handle any collection-type ...
3
votes
2
answers
3k
views
Inverting index structure in C++
I am trying to create an invert index structure in C++. An invert index, in this case, refers to image retrieval system, where each invert index refers to a numbers of "Patch ID". (simply called "ID" ...
1
vote
1
answer
321
views
Displaying plotted data in serpentine order
I have to display some set of:
Data in serpentine order. In an experiment there are replication, range, and plot.
Replications contains range a plot. A range contains a plot.
If there are 2 ...
3
votes
1
answer
678
views
Intersection-detection algorithm
This is an intersection-detection algorithm I developed as an alternative method to the one developed for my coursework. I won't post some of the other functions as they are used in the coursework too,...