aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_container_lib.h
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-03-12 17:32:10 +0000
committerNathan S. Evans <evans@in.tum.de>2010-03-12 17:32:10 +0000
commit5491c6356965f9c20ef64f2c63f7a14989930bf3 (patch)
tree3aaea35bd6ad67e13b686ad2b4b9b4aed2d3bfd0 /src/include/gnunet_container_lib.h
parent54ce17ec50827d3a905a3cb182ccd3c18bbd3668 (diff)
downloadgnunet-5491c6356965f9c20ef64f2c63f7a14989930bf3.tar.gz
gnunet-5491c6356965f9c20ef64f2c63f7a14989930bf3.zip
adding random_heap function definition in case I add it another way
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r--src/include/gnunet_container_lib.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index 204d3d6ab..bec040596 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -829,6 +829,21 @@ GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap,
829 829
830 830
831/** 831/**
832 * Return a *uniform* random element from the heap. Choose a random
833 * number between 0 and heap size and then walk directly to it.
834 * This cost can be between 0 and n, amortized cost of logN.
835 *
836 * @param heap heap to choose random element from
837 * @param max how many nodes from the heap to choose from
838 *
839 * @return data stored at the chosen random node,
840 * NULL if the heap is empty.
841 *
842 */
843void *
844GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, uint32_t max);
845
846/**
832 * Perform a random walk of the tree. The walk is biased 847 * Perform a random walk of the tree. The walk is biased
833 * towards elements closer to the root of the tree (since 848 * towards elements closer to the root of the tree (since
834 * each walk starts at the root and ends at a random leaf). 849 * each walk starts at the root and ends at a random leaf).