<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reservoir Sampling on Algorithm Solutions</title><link>https://algorithm.liangqin.ren/tags/reservoir-sampling/</link><description>Recent content in Reservoir Sampling on Algorithm Solutions</description><generator>Hugo -- gohugo.io</generator><lastBuildDate>Fri, 28 Aug 2026 10:18:35 -0500</lastBuildDate><atom:link href="https://algorithm.liangqin.ren/tags/reservoir-sampling/index.xml" rel="self" type="application/rss+xml"/><item><title>382. Linked List Random Node</title><link>https://algorithm.liangqin.ren/leetcode/382/</link><pubDate>Fri, 28 Aug 2026 10:18:35 -0500</pubDate><guid>https://algorithm.liangqin.ren/leetcode/382/</guid><description>1. Description Given a singly linked list, return a random node&amp;rsquo;s value from the linked list. Each node must have the same probability of being chosen.
Implement the Solution class:
Solution(ListNode head) Initializes the object with the head of the singly-linked list head. int getRandom() Chooses a node randomly from the list and returns its value. All the nodes of the list should be equally likely to be chosen. Follow up:</description></item></channel></rss>