top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How do you shuffle a binary tree without using any external data structures.

+1 vote
236 views

How do you shuffle a binary tree without using any external data structures.
Note: With equal probability to every node.

posted Sep 11, 2014 by Atiqur Rahman

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
Can I use an array???
Suppose array is allowed then we can create an array out of the binary tree (delete node when you take out an element) so at the end u have an array and null tree. Now choose random element from the array and insert into the tree till end. Please comment if looking something different.
No extra space is allowed and the structure of the BT should not change... sorry for late comment!
I give up :) no clue at all
You can answer for the larger audience reach :)

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...