Transpose a Matrix in Clojure
Imagine rows of letters, numbers, and Greek letters: [[:a :b] [:1 :2] [:alpha :beta]] Now, you want to transpose them. You started with a vector of vectors. Clojure's map function is pretty amazing

Search for a command to run...
Articles tagged with #clojure
Imagine rows of letters, numbers, and Greek letters: [[:a :b] [:1 :2] [:alpha :beta]] Now, you want to transpose them. You started with a vector of vectors. Clojure's map function is pretty amazing

I decided to implement linear search before going after binary search. Now, I’m ready! With linear search, we required the elements be sorted. We didn’t require the elements be bounded. In binary search, the inputs must be bounded because we maintain...

I consider myself a classically trained computer scientist. However, I don’t regularly practice implementing algorithms at home. I hope to do more of that! At work, I do much higher level things, like partnering with a product manager, establishing a...

+ In Clojure core there’s a handy function, +. I’ll bet you know what it does: (+ 1 2 3) ;;=> 6 Let’s introduce a handy function as we explore: (defn value-and-type [& args] (map (juxt identity type) args)) Let’s look at the largest supported L...

Computers do math really quickly. Yet, computers struggle with all kinds of things with math. Take, for example, the simple fraction: 2/3. This should be easy to store right? In most languages, it isn’t. We’re going to use 2/3 throughout all our exam...

My son asked me if I could make the computer double numbers, like 2 4 6 → 22 44 66 I started with a really ugly solution: (map (fn [x] (parse-long (clojure.string/join "" [(str x) (str x)]))) [2 4 6]) ;;=> (22 4...
