Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [collections]

Collections APIs provide developers with a set of classes and interfaces that makes it easier to handle collections of objects.

42
votes
3answers
10k views

List<T> implementation for VB6/VBA

Recently I decided VB6's Collection wasn't enough for my needs, so I decided to implement something like C#'s List<T>. ...
10
votes
3answers
594 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
2answers
341 views

Non generic Skip List implementation in C++ Version 2

Edit: This code was reworked and repostetd under a new question: Generic Skip list implementation in C++ Version 3 This is a follow up of: Non generic Skip List implementation in C++ If you don't ...
6
votes
1answer
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 ...
14
votes
3answers
4k views

Building a better Collection. Enumerable in VBA

VBA's 'Collection' is.... lacking, so, I've been working on a better Collection object that implements many of the features of C#'s Enumerable. This is very much inspired by this question and a follow ...
17
votes
2answers
1k views

O(1) lock free container

This is a lock-free Container class. By Container I mean it will hold objects for iteration at a later time. To achieve \$O(1)\$ ...
7
votes
1answer
400 views

Generic Skip list implementation in C++ Version 3

This is a follow up of Non generic Skip List implementation in C++ Version 2 If you don't know what a Skip list is: https://en.wikipedia.org/wiki/Skip_list I tried to incorporate as much ...
28
votes
4answers
2k views

Just a lowly counter that turned out to be surprisingly complicated

While writing this review, I saw a need for a Counter object similar to Python's. It seemed like it would be easy to write such a class, but it turned out to be ...
6
votes
1answer
166 views

Cascading a property for a game

I'm trying to write a simple game. I have an Entity object, that has a list of Sprite objects. Each ...
11
votes
1answer
220 views

Array-like container for uints shorter than 8 bits

Follow-up: Array-like container for uints shorter than 8 bits (Rev 1) First of all: yes, I need this kind of array to generate data for a piece of hardware, and it must be stored and manipulated ...
10
votes
2answers
8k views

Sorting a collection

Related to, but not exactly a follow up of this question. After fixing some issues discovered in the last review, I added a little more functionality to the ...
9
votes
2answers
209 views

Multi-dimensional container using operator[]

This is a late followup to a previous question of mine on same subject. Context: I want to have a tool that allows to use all the C++ goodies (algorithms, for loop on containers, etc.) on a ...
7
votes
2answers
346 views

Array-like container for uints shorter than 8 bits (Rev 1)

This is a follow-up to Array-like container for uints shorter than 8 bits In short: The PackedBitfieldArray should be a kind of container for packed (unsigned) ...
6
votes
1answer
860 views

Implementation of fixed size queue using a ring (cyclic) buffer

I found myself in need of a fixed size queue and decided to implement one using a ring (cyclic) buffer. I have tried my best to match the API of std::queue with ...
6
votes
1answer
109 views

Class containers, filtering and coding practices

Context Usually, when I have to deal with a collection of items (especially objects) I tent to create a container class for that collection (wrapper?). What I mean by that is: when I have to handle ...
6
votes
2answers
438 views

Iterator of Container of Container

Based on this question I though I would pull together an iterator that iterated over a container of containers. ...
6
votes
1answer
718 views

C++11 lock free collection similar to std::forward_list - follow-up

This question has been superseded by C++11 lock free collection similar to std::forward_list - follow-up 2 Thread safe and lock free collections are very hard to write, so I'd appreciate any feedback,...
4
votes
1answer
1k views

Union of intervals

I am trying to solve for the problem with a bunch of intervals: (1,2),(2,5),(4,7),(9,11) I find their union, which in the above given case would be: ...
3
votes
2answers
64 views

Automatically keyed map

I have written a class that is designed to be an automatically keyed Map in Java. Here is my implementation: ...
9
votes
0answers
164 views

Multi-function memoizator and multi-type container

I'm trying to write a multiple functions memoizator, which I've talked about here. The main problem is creating a container containing different and heterogenous functions. I found a working solution,...
7
votes
3answers
433 views

Custom collection implementing IList<T> saving current, next and previous element

I'm developing a Tic Tac Toe game where you can change your pawn look Now as You can see it has 2 buttons one for next one for previous, and You can also pick if you want to edit the O or the X ...
7
votes
3answers
545 views

A Java subclass of ArrayList that supports rotation in constant time

(See the next iteration.) I have subclassed java.util.ArrayList in order to be able to "rotate" it in constant time simply by moving a finger index. See what I ...
4
votes
2answers
148 views

Non generic Skip List implementation in C++

Edit: This code was reworked and repostetd under a new question: Non generic Skip List implementation in C++ Version 2 To sharpen my C++ skills I tried to implement a skip list. I was quite happy ...
4
votes
1answer
69 views

Fill a new Workbook with info from another workbook

I made a macro that will fill in data in a workbook that has 65 (24 are user filled) columns and can go as long as 1500 rows. In an ideal scenario, the workbook has a perfect column that could work ...
4
votes
1answer
57 views

General use multi-dimensional container using operator[]

This is a followup to a previous question of mine on same subject. Context I want to have a tool that allows to simulate as much as possible a C++ standard container for a multidimensional ...
3
votes
1answer
55 views

Python JIT container type

This is a follow on from this review. Where I am attempting to improve the performance of my rest client. I have created an container type (as suggested in my previous post) that lazily instantiates ...
3
votes
2answers
916 views

Kings Drinking Game

This Review Request evolves into this Review Request now with a custom UI and other changes. I wrote a program to simulate the drinking card game Kings. This is my third Java Project. I didn't quite ...
3
votes
1answer
6k views

Generating all subsets of a given set

I am learning Java Collections Framework. Can someone look at this code for generating all subsets of a given set and tell me any issues with it. ...
3
votes
0answers
69 views

Allowing switching between operator[] and at() based on NDEBUG macro version

The problem: std::vector and other containers have two functions for accessing / modifying their content: operator[] and ...
2
votes
2answers
112 views

Vector replacer

I rolled an own vector-like construct with improved performance and got it reviewed. Here is the updated version. ...
2
votes
1answer
40 views

Generic Macro Generated Linked List in C

Generate a linked list of any type using macros. The linked list contains functions for adding and removing elements to both ends and also at the middle. You can also add elements relatively to a list ...
2
votes
1answer
155 views

C++11 lock free collection similar to std::forward_list - follow-up 2

Thread safe and lock free collections are very hard to write, so I'd appreciate any feedback, especially regarding bugs. The code below is a self contained hpp, followed by some tests. This question ...
2
votes
1answer
1k views

Vector-like custom container with improved insert performance

I rolled a little container class (just for couriosity) which was meant to be able as a vector replacement in some cases. (Whoever wonders about the lack of move semantic etc, I just left it out due ...
2
votes
1answer
249 views

Auto-resizing array, that accepts negative indexes

I've been coding a helper container template to contain tiles in 2D games. What I figured out I would like when writing code for my games is forgetting all resize stuff, allowing negative indexes (for ...
1
vote
1answer
82 views

Python: rearranging data collection

Let's say I have a data collection, like a list, containing a set of objects with particular properties. Let's go with animals: [ cow, sheep, orangutan ] An ...
1
vote
2answers
99 views

Threadsafe filtering queue

I have implemented a thread safe filtering queue. The queue allows any objects, of the specified type to be added. A thread interested to take an object must specify which object it is interested in ...
1
vote
0answers
70 views

Allowing switching between operator[] and at() based on NDEBUG

The problem: std::vector and other containers have two functions for accessing / modifying their content: operator[] and ...
0
votes
1answer
114 views

A Java subclass of ArrayList that supports rotation in constant time - follow-up

(See the previous (and initial) iteration.) Compared to the previous iteration, I have added more methods that maintain the invariant required for constant time rotations, such as bulk add/remove, ...