Problem Is there a better, more elegant solution to the following method? Boolean[] spades = new Boolean[10]; // 40 cards […]
Tag: c#
Union, Intersection and Diff of two sorted arrays in C#
Problem This is the original question https://www.geeksforgeeks.org/union-and-intersection-of-two-sorted-arrays-2/ Given two sorted arrays, find their union and intersection. Example: Input : arr1[] […]
Recursive implementation of merge sort
Problem Information about my code: I am following this MIT OCW algorithms course. The first lecture described insertion sort and […]
Student Classroom class
Problem I’d like to know if the following class design is good or bad: #include <iostream> #include <vector> #include <string> […]
Using a UserPermissionService by all Presenters in the Application to control the access to commands
Problem I’m handling user permission in a MVP Winforms application as follows. Here I’ll give a full detail of my […]
MSD radix sort in C
Problem This time, I have rewritten my radix sort implementation from C++ to C: integer_sort.h: #ifndef INTEGER_SORT_H #define INTEGER_SORT_H #include […]
General Retry Strategy #3 with TryResult
Problem I wanted to use the Try helper from @DmitryNogin’s General Retry Strategy #2 but each attempt to implement it […]
Which option is better for readability when dealing with blank strings?
Problem I’m working off a specification that says a bunch of fields within a record (one record being one line) […]
“Sharing CANDY” on SPOJ
Problem How can I improve it and its running time efficiency? Problem (SPOJ/CANDY) Jennifer is a teacher in the first […]
A reference source for primes up to 64K (for unit tests)
Problem In order to code the tests for my number theory library (a collection of routines that proved handy for […]