The Ruby Programming Language
Although data structures and algorithms we study aren't tied to any program or programming language, we need to write particular programs in specific languages to practice implementing and using data structures and algorithms that we learn.
Ruby is an interpreted, purely object-oriented language with numerous powerful features, such as garbage collection, hash tables, dynamic arrays, and rich string processing facilities. We use Ruby because it's a fairly popular, full-featured, object-oriented language however it can be learned well enough to write substantial programs fairly quickly. Hence we will be able to use a powerful language and still have time to concentrate on data structures and algorithms that is what we are really interested in. Additionally, it is free.
Ruby is dynamically typed, doesn't support design-by-contract and has a somewhat frugal collection of features for object-oriented programming. Even though this makes language easier to learn and use, it also opens up many opportunities for errors. Careful attention to types and mechanisms to help detect type errors early, fully understanding preconditions for executing methods and thoughtful use of class hierarchies are significant for novice programmers, so we would pay close attention to these matters in our discussion of data structures and algorithms and we will, when possible, incorporate this material into Ruby code. This sometimes results in code which doesn't conform to the style prevalent in the Ruby community. Although, programmers should understand and appreciate these matters so that they can handle data structures in more strongly typed languages like Java, C++, or C#.