Posts Tagged ‘data structures’
Friday, May 8th, 2020
Before we can start delving into LINQ, we need to first understand the underlying principles upon which it is built. LINQ is all about operations over collections, so, you’ve guessed it: we will be dealing with collections.
You already learned that of all data structures, arrays are the fastest, because they are unsorted non-generic data structures.… Read more
Tags: data structures, Enumerable, foreach loop, IEnumerable, IEnumerator, interface, linq, loops, while loop
Posted in LINQ | 4 Comments »
Thursday, June 14th, 2018
There are two types of Sets in the System.Collections.Generic namespace: SortedSet and HashSet. Both of them offer the functionality of storing non-duplicate items. The main difference between them is the fact that the SortedSet obviously has its items sorted. Therefor, if you do not care about the order in which the items are stored, you are better off performance-wise to use a HashSet.… Read more
Tags: data structures, hashset
Posted in Data Structures | No Comments »
Friday, June 8th, 2018
Sorted Dictionary is just a normal Dictionary data structure, but with its keys sorted. Of course, it is obvious that having its elements sorted will make this data structure slightly slower than a normal Dictionary, but it does offer the advantage of making an in memory sorted lookup very easy.… Read more
Tags: data structures, sorted dictionary
Posted in Data Structures | No Comments »
Friday, June 1st, 2018
The data structure Dictionary suggests storing key-value pairs and provides a quick search by key. In common language, this means that instead of elements receiving a numerical index, as in the array case, they receive a specific type as a key (this is what the K stands for in the Dictionary<K, T> concept; T stands for the type of the values stored in the dictionary) for accessing elements.… Read more
Tags: data structures, dictionary
Posted in Data Structures | 2 Comments »
Monday, May 28th, 2018
Queue is a linear data structure in which there are two operations defined: adding an element to the tail (enqueue) and extract the front-positioned element from the head (dequeue). These two operations take a constant time to execute, because the queue is usually implemented with a linked list.… Read more
Tags: data structures, queue
Posted in Data Structures | No Comments »
Wednesday, May 2nd, 2018
Stack is a linear data structure in which there are 3 operations defined: adding an element at the top of the stack (push), removing an element from the top of the stack (pop) and inspect the element from the top without removing it (peek).… Read more
Tags: data structures, stack
Posted in Data Structures | No Comments »
Tuesday, May 1st, 2018
Dynamic list (List<T>) is one of the most popular data structures used in programming. It does not have fixed size like arrays, and allows direct access through index, unlike linked lists (LinkedList<T>). The dynamic array is also known as “array list”, “resizable array” and “dynamic array”.… Read more
Tags: data structures, list
Posted in Data Structures | No Comments »
Tuesday, April 24th, 2018
Singly and doubly linked lists (also known simply as Linked Lists) hold collection of elements, which preserve their order. Their representation in the memory is dynamic, pointer-based. They are linked sequences of elements. Adding is a fast operation, but it is a bit slower than adding to a List, because every time when we add an element to a linked list, we allocate a new memory area.… Read more
Tags: data structures, linked list
Posted in Data Structures | No Comments »