Problem I was asked to print numbers from 100 to 1 in a for loop with the index starting from […]
Category: Array
Roast my C# birthday code
Problem So this is a pretty simple code, I think it was? It asks for the user’s birth day and […]
Game on numeric arrays
Problem Two participants, A and B, are playing the following game: The initial set of games is a sequence of […]
Short and Messy Polybius Square
Problem I attempted to recreate the Polybius square, also called the Polybius checkerboard, which was used in Ancient Greece for […]
FiniteArrayQueue type with interface and unit tests
Problem Doing some exercises on basic data structures, I learned about queues, and decided to roll my own to better […]
Heap selection sort in Javascript
Problem I have (designed and) implemented this fancy sorting algorithm that combines natural runs in the input array with a […]
Finding Second Largest Element in an Array
Problem Here’s my implementation using divide and conquer in C++. What do you think of this implementation regarding running time […]
Menu driven program to represent polynomials as a data structure using arrays
Problem Write a menu-driven program to represent Polynomials as a data structure using arrays and write functions to add, subtract […]
Copy part of array in javascript
Problem I have an array and must fill another one. Depending of a boolean I copy first or second element […]
Sorting and slicing array, based on another “weight” array?
Problem I have the following input array: $arr = array( ‘water’ => array(0, 1, 2, 3, 4, 5), ‘apple’ => […]