Given a singly linked list, select a random node from the linked list (the probability of picking a node should be 1/N if there are… Read More

# Category Archives: Randomized

There are many ways of classifying algorithms and a few of them are shown below: Implementation Method Design Method Other Classifications Classification by Implementation Method:… Read More

Generating Random Unweighted Binary Tree: Since this is a tree, the test data generation plan is such that no cycle gets formed. The number of… Read More

Given a positive integer N, the task is to generate a random binary string of length N. Examples: Input: N = 7Output: 1000001 Input: N… Read More

Given an integer N. A number guessing game is a simple guessing game where a user is supposed to guess a number between 0 and… Read More

Given two integers N and K, where N represents the total number of cards present when game begins and K denotes the maximum number of… Read More

Given four integers N, R, X, and Y such that it represents a circle of radius R with [X, Y] as coordinates of the center.… Read More

If we keenly observe, randomness can be effectively derived from nature. Despite being explainable by scientific phenomena, the behavior of most matter on earth is… Read More

If the receiver proclaims a large window-size, larger than what the network en-route can manage, then there will always be packet losses. So there will… Read More

Given a number N, the task is to construct a square matrix of N * N where union of elements in some ith row with… Read More