Ruby tap() vs yield_self()

Ruby’s tap and yield_self methods are two powerful tools that can be used to chain method calls and transform data in a functional programming style. In this article, we will discuss how tap and yield_self work, and how they can be used in real-world scenarios.

August 3, 2024 · 4 min · 772 words · Bá Tới

Some Algorithms Based on Divide and Conquer Principles in Ruby - Part 3

Explore algorithms based on divide and conquer principles in Ruby, including Kruskal’s algorithm for minimum spanning tree, line intersection, and parallel algorithms for connected components, with examples and implementations.

July 13, 2024 · 4 min · 773 words · Bá Tới

Some Algorithms Based on Divide and Conquer Principles in Ruby - Part 2

Explore some algorithms based on divide and conquer principles in Ruby, including the Master Theorem, Fast Walsh-Hadamard Transform, Counting Inversions, Skyline Problem, Maximum Subarray Problem, Sparse Table, Planar Point Location, Maximum Flow Problem, Dynamic Programming Optimization, and Discrete Fourier Transform.

July 13, 2024 · 9 min · 1910 words · Bá Tới

Some Algorithms Based on Divide and Conquer Principles in Ruby - Part 1

Some example of divide and conquer algorithms in Ruby, including binary Karatsuba Algorithm, Fast Fourier Transform (FFT), Closest Pair of Points, Convex Hull, Optimal Binary Search Tree, VLSI Layout, Tower of Hanoi, Multipoint Polynomial Evaluation and Interpolation, Medians and Order Statistics, Ternary Search.

July 13, 2024 · 11 min · 2266 words · Bá Tới

Linked List Algorithms in Ruby

Learn about linked list algorithms in Ruby, including linked list traversal, insertion, deletion, and reversal, with examples and comparisons of their performance.

July 13, 2024 · 2 min · 364 words · Bá Tới

Backtracking Algorithms in Ruby

Learn about backtracking algorithms in Ruby, including the N-Queens problem, Sudoku solver, and Knight’s tour problem, with examples and comparisons of their performance.

July 13, 2024 · 8 min · 1646 words · Bá Tới

Greedy Algorithms in Ruby

Learn about greedy algorithms in Ruby, including the greedy algorithm paradigm, examples of greedy algorithms, and their applications in solving optimization problems.

July 13, 2024 · 6 min · 1242 words · Bá Tới

Graph Algorithms in Ruby

Learn about graph algorithms in Ruby, including depth-first search (DFS), breadth-first search (BFS), Dijkstra’s algorithm, and A* search, with examples and comparisons of their performance.

July 13, 2024 · 6 min · 1252 words · Bá Tới

Tree Algorithms in Ruby

Learn about tree algorithms in Ruby, including tree traversal, binary search trees, and balanced trees, with examples and comparisons of their performance.

July 13, 2024 · 8 min · 1493 words · Bá Tới

Search Algorithms in Ruby

Learn about search algorithms in Ruby, including linear search, binary search, and interpolation search, with examples and comparisons of their performance.

July 13, 2024 · 5 min · 920 words · Bá Tới