Bloomberg | Phone | Shuffle Cards
Anonymous User
3746

A linked list of cards are given. Write a code, to Shuffle the cards, without using inbuilt shuffle / random functions.
Functionalities :

  1. Create a deck of card through linked list
  2. Split the deck of cards randomly into 2 subsets
  3. Merge the subsets randomly , so that previous order is not maintained
  4. Display the deck of cards .

Eg:
I/p Cards: [A,4,6,7,9,K,Q,J,2]
Expected Output:
Create Linked List : [A->4->6->7->9->Q->J->2]
Split List into 3 decks : A->4->6->7 9->Q J->2
Merge the decks randomly : 9->6->7 ->Q ->J->2->4->A

Similiar Problem : [ Interviewer asked to solve using linked list ] https://leetcode.com/problems/shuffle-an-array/

Comments (9)