home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / misc / mas / mashelp / sacsym2.def < prev    next >
Encoding:
Modula Definition  |  1991-03-18  |  931 b   |  38 lines

  1.  
  2. DEFINITION MODULE SACSYM2;
  3.  
  4. (* SAC Symbol 2 Definition Module. *)
  5.  
  6.  
  7. FROM MASSTOR IMPORT LIST;
  8.  
  9.  
  10. PROCEDURE STBAL(L,n: LIST): LIST;
  11. (*Symbol tree balance. L is an alphabetical list of n symbol-tree 
  12. nodes (n gt 0), out of which a balanced binary tree S is constructed. *)
  13.  
  14.  
  15. PROCEDURE STBALS(VAR A: ARRAY OF LIST; l, r: INTEGER): INTEGER;
  16. (*Symbol tree balance subroutine. The array A contains symbol-tree
  17. nodes in alphabetical order. The binary tree of the symbols in
  18. A[l..r] is constructed and A[m] is its root. *)
  19.  
  20.  
  21. PROCEDURE STNLST(T: LIST; VAR L,n: LIST);
  22. (*Symbol tree nodes list. T is a non-empty symbol tree.
  23. L is the list of its nodes in alphabetical order of the 
  24. corresponding symbols and n the number of nodes. This algorithm
  25. is normally used for creating the data as required for STBAL. *)
  26.  
  27.  
  28. PROCEDURE SSYTBAL;
  29. (*System symbol tree balance. SYMTB is balanced. *)
  30.  
  31.  
  32. END SACSYM2.
  33.  
  34.  
  35.  
  36.  
  37.  
  38.