home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16097 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.0 KB

  1. Path: sparky!uunet!destroyer!gumby!wmichgw!873clifton
  2. From: 873clifton@gw.wmich.edu
  3. Newsgroups: comp.lang.c
  4. Subject: Source for pointer based heapsort?
  5. Message-ID: <1992Nov6.165140.6197@gw.wmich.edu>
  6. Date: 6 Nov 92 16:51:40 EST
  7. Organization: Western Michigan University
  8. Lines: 26
  9.  
  10. Hello fellow C programmers:
  11.  
  12. Not having any luck searching: archie, usenet comp.sources groups,
  13. netlib, etc, I thought I might post a request for source hear. I
  14. am trying to implent heap building and heapsort using a struct
  15. pointer based method rather than the classic array based method.
  16. I searched every book on data structures/algorithms I could lay
  17. hands on as well as many programming periodicals, but all of them
  18. used the array based method. My proposed structure would look 
  19. something like this:
  20.  
  21. typedef struct _hnode    {
  22.     int data;
  23.     struct _hnode *rchild;    /* right child */
  24.     struct _hnode *lchild;  /* left child */
  25.     ...
  26. } hnode;
  27.  
  28. If some kind soul has solved this problem, could they please
  29. Email me their source.
  30.  
  31. Thanks,
  32.  
  33. /Doug
  34. --
  35. Douglas Clifton [99clifto@lab.cc.wmich.edu]
  36.