tagged [data-structures]

How to simulate tuples and sets in C#?

How to simulate tuples and sets in C#? I want to use some features of python like as Tuples and Sets in c#. should I implement them? or there are already implemented? could anybody knows a library of ...

11 Apr at 07:6

How do I get the n-th element in a LinkedList<T>?

How do I get the n-th element in a LinkedList? How can I get the n-th element of a LinkedList instance? Is there a built-in way or I might need to introduce my own implementation? For example an exten...

15 Apr at 17:29

How to print binary tree diagram in Java?

How to print binary tree diagram in Java? How can I print a binary tree in Java so that the output is like: My node:

Ideas about Generating Untraceable Invoice IDs

Ideas about Generating Untraceable Invoice IDs I want to print invoices for customers in my app. Each invoice has an . I want IDs to be: - - - Number of since a specific date & time (e.g. 1/1/2010 00...

12 Aug at 06:47

When should I use a List vs a LinkedList

When should I use a List vs a LinkedList When is it better to use a [List](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1) vs a [LinkedList](https://learn.microsoft.com...

Hashtable implementation for Delphi 5

Hashtable implementation for Delphi 5 Do you know a good and free Hashtable imlementation for Delphi 5 ? I need to organize a huge amount of data in a hastable and I am bit worried about memory leak i...

How to implement a tree data-structure in Java?

How to implement a tree data-structure in Java? Is there any standard Java library class to represent a tree in Java? Specifically I need to represent the following: - - - Is there any available struc...

16 Mar at 23:4

Merge 2 arrays using LINQ

Merge 2 arrays using LINQ I have two simple array and I would like to merge using join linq:

15 Apr at 11:10

Move elements in list

Move elements in list I declare following object I would like to move "Eve" at front of my list? How can I do that. I must not to reorder other elements! At output I want to get this

31 Jan at 15:2

Is there a "Set" data structure in .Net?

Is there a "Set" data structure in .Net? Ideally, I'm looking for a templated logical Set class. It would have all of the standard set operations such as Union, Intersection, Etc., and collapse duplic...

25 Aug at 12:57

How do I sort a list of dictionaries by a value of the dictionary?

How do I sort a list of dictionaries by a value of the dictionary? How do I sort a list of dictionaries by a specific key's value? Given: When sorted by `name`, it should become:

Split a collection into `n` parts with LINQ?

Split a collection into `n` parts with LINQ? Is there a nice way to split a collection into `n` parts with LINQ? Not necessarily evenly of course. That is, I want to divide the collection into sub-col...

20 May at 19:34

How to compare table structure in SAS

How to compare table structure in SAS I am a tester and I need to compare two data sets structure (not table data) in SAS. I tried to use 'proc compare' but it compares the data. I want to compare dat...

11 Jun at 08:26

Difference between "Complete binary tree", "strict binary tree","full binary Tree"?

Difference between "Complete binary tree", "strict binary tree","full binary Tree"? I am confused about the terminology of the below trees, I have been studying the Tree, and I am unable to distinguis...

4 May at 04:58

How to check if a key/value pair exists in a Dictionary?

How to check if a key/value pair exists in a Dictionary? How can one check if a key/value pair exists in a `Dictionary`? I'm able to check if a key or value exist, using `ContainsKey` and `ContainsVal...

16 Dec at 13:30

Fibonacci, Binary, or Binomial heap in c#?

Fibonacci, Binary, or Binomial heap in c#? Are there any heap data structure implementations out there, fibonacci, binary, or binomial? Reference: These are data structures used to implement priority ...

9 Jan at 16:50

check if a number already exist in a list in python

check if a number already exist in a list in python I am writing a python program where I will be appending numbers into a list, but I don't want the numbers in the list to repeat. So how do I check i...

22 Dec at 13:11

Is there pointer in C# like C++? Is it safe?

Is there pointer in C# like C++? Is it safe? I'm writing an application that work with a tree data structure. I've written it with C++, now i want to write it by C#. I use pointers for implementing th...

1 Aug at 11:19

When should I use the HashSet<T> type?

When should I use the HashSet type? I am exploring the `HashSet` type, but I don't understand where it stands in collections. Can one use it to replace a `List`? I imagine the performance of a `HashSe...

8 Aug at 14:2

Generic Key/Value pair collection in that preserves insertion order?

Generic Key/Value pair collection in that preserves insertion order? I'm looking for something like a Dictionary however with a guarantee that it preserves insertion order. Since Dictionary is a hasht...

8 Sep at 22:42

How can I return an anonymous type from a method?

How can I return an anonymous type from a method? I have a Linq query that I want to call from multiple places: How can I create a method, put this code in it, and then call it? ``` publi

Dictionary with limited size that removes oldest elements?

Dictionary with limited size that removes oldest elements? Is there an existing data structure usable for hashing data that will give ability to delete the oldest element? The approach that I am think...

2 Apr at 00:38

Is there any graph data structure implemented for C#

Is there any graph data structure implemented for C# I tried to find a graph data structure to reuse in C# without any success. Of course, I can borrow from data structure books but I want it to be mo...

3 Jul at 15:32

Order-preserving data structures in C#

Order-preserving data structures in C# MSDN has no information on the order preserving properties of data structures. So I've been making the assumption that: - - From this I extrapolate that if I hav...

2 May at 09:25

Fundamental Data Structures in C#

Fundamental Data Structures in C# I would like to know how people implement the following data structures in C# without using the base class library implementations:- - - - - - - - and any other funda...

7 Sep at 10:54