Contests of code
State Design Pattern
- Hits: 1497
"The state design pattern allows for full encapsulation of an unlimited number of states on a context for easy maintenance and flexibility."
- Hits: 1221
It is used in scenarios where application needs to create a number of instances of a class, which has almost same state or differs very little.
- Hits: 6194
Provide an interface for creating dependent objects without specifying their concrete classes.
Binary Search Tree
- Hits: 1268
The Binary Search Tree is a data structure that store "items" (such as numbers, names etc.) in memory.
- Hits: 1282
It is based on
TreeMap, the main different is that
TreeSet is an implementation of
Set interface and
This kind of collection sorts your entries just when they are inserted. No need to call
- Hits: 2697
Recently, I participate in the awesome coding contest The Accountant in CodinGames. This contest was a 2-week optimization challenge, where it was not necessary to succeed all of the given test cases to have a good score. Unfortunately, I didn't use the 2 week because I was travelling. I only used 5 days.
It was my second time in this kind of contests, and I finished in the position 1774/6214 ( you can see the report in The Accountant report for my user cguzman ). Not so bad for a second time :)
I am not an expert in Genetic Algorithm (GA), but I decided to implement one for this solution. Thus, now I will explain how was my approach for this challenged.
- Hits: 2536
The Trie is an ordered tree data structure used usually to store strings, in which case each node defines an association with a letter of the alphabet. Unlike a binary search tree, no node in the tree stores the key associated with that node; instead, its position in the tree defines the key with which it is associated.
- Hits: 1164
Builder pattern is an alternative way to construct complex objects and should be used only when the increase of object constructor parameter combination leads to an exponential list of constructors. Instead of using numerous constructors, the builder pattern uses another object, a builder, that receives each initialization parameter step by step and then returns the resulting constructed object at once.