1. #include <iostream> 
  2. using namespace std; 
  3.  
  4. #define   MAXSIZE 11 
  5. #define   NULLKEY -1 
  6. #define   DELKEY  -2 
  7. typedef int ElemType; 
  8. typedef struct 
  9.     ElemType key; 
  10.     int count;               //探查次数 
  11. }HashTable[MAXSIZE]; 
  12.  
  13. int SearchHT(HashTable ha, ElemType key) 
  14.     int adr = 0 ; 
  15.     adr = key % MAXSIZE; 
  16.  
  17.     while(ha[adr].key != NULLKEY  && ha[adr].key != key) 
  18.     {   adr = (adr + 1) % MAXSIZE;}                    //此处应该对数组的最大长度进行求余 
  19.     if(ha[adr].key == key)  return adr; 
  20.     else return -1; 
  21.  
  22. int DeleteHT(HashTable ha,ElemType key, int &num) 
  23.     int adr = 0; 
  24.     adr = SearchHT(ha,key); 
  25.     if(adr == -1) return -1; 
  26.     else {  ha[adr].key = DELKEY; ha[adr].count = 0;--num;} 
  27.     return 1; 
  28. void DispHT(HashTable ha); 
  29. void InsertHT(HashTable ha, ElemType key, int &num) 
  30. {   
  31.     int adr = 0, count = 1; 
  32.     adr = key % MAXSIZE; 
  33.  
  34.     while(ha[adr].key != NULLKEY && ha[adr].key != DELKEY) 
  35.     { 
  36.         ++count; 
  37.         adr = (adr + 1) % MAXSIZE; 
  38.         if(count > MAXSIZE)   { cout<<"the table is full!!!"<<endl; return ;} 
  39.     } 
  40.     if(ha[adr].key == NULLKEY || ha[adr].key == DELKEY) 
  41.     {   ha[adr].key = key; 
  42.         ha[adr].count = count; 
  43.         ++num; 
  44.     } 
  45.  
  46. void CreateHT(HashTable ha, ElemType keys[], int len, int &num) 
  47.     int loop1 = 0; 
  48.     for(loop1 = 0; loop1 < MAXSIZE ; ++loop1) 
  49.     { 
  50.         ha[loop1].key = NULLKEY; 
  51.         ha[loop1].count = 0; 
  52.     } 
  53.   
  54.       
  55.     for(loop1 = 0; loop1 < len ; ++loop1) 
  56.         InsertHT(ha,keys[loop1],num); 
  57.       
  58.  
  59. void DispHT(HashTable ha) 
  60.     int loop1 = 0; 
  61.       
  62.     for (loop1 = 0; loop1 < MAXSIZE; ++loop1) 
  63.         printf("%5d",loop1); 
  64.     printf("\n"); 
  65.     for(loop1 = 0;loop1 < MAXSIZE ; ++loop1) 
  66.     { 
  67.         if(ha[loop1].key != NULLKEY && ha[loop1].key != DELKEY) 
  68.             printf("%5d",ha[loop1].key); 
  69.         else printf("     "); 
  70.     } 
  71.     printf("\n"); 
  72.     for(loop1 = 0; loop1 < MAXSIZE; ++loop1) 
  73.     { 
  74.         if(ha[loop1].count != 0) 
  75.             printf("%5d",ha[loop1].count); 
  76.         else printf("     "); 
  77.     } 
  78.     printf("\n"); 
  79.  
  80. void CompASL(HashTable ha, int num) 
  81.     int loop1 = 0, total = 0; 
  82.     for(loop1 = 0; loop1 < MAXSIZE; ++loop1) 
  83.         total += ha[loop1].count; 
  84.     cout<<"average find length is :"<<(total * 1.0 / num)<<endl; 
  85.  
  86. void CompUNASL(HashTable ha) 
  87.     int total = 0, loop1 = 0, loop2 = 0; 
  88.  
  89.     for(loop1 = 0; loop1 < MAXSIZE; ++loop1) 
  90.     { 
  91.         loop2 = loop1; 
  92.         while(ha[loop2].count != 0) 
  93.         { 
  94.             ++total; 
  95.             loop2 = (loop2 + 1) % MAXSIZE; 
  96.         } 
  97.         ++total; 
  98.     } 
  99.     cout<<"the average unfind length is :"<<(total * 1.0 / MAXSIZE)<<endl; 
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. int SearchHT2(HashTable ha, ElemType key) 
  113.     int flag = 1, var = 1, adr = 0, adr1 = 0; 
  114.  
  115.     adr1 = adr = key % MAXSIZE; 
  116.  
  117.     while(ha[adr].key != key && ha[adr].key != NULLKEY) 
  118.     { 
  119.         adr = (adr1 + var * var * flag) % MAXSIZE;             //采用开放定址法,H(key) = ( H(k) + d ) % MAXSIZE 
  120.         if(adr >= MAXSIZE || adr < 0)  
  121.             return -1; 
  122.  
  123.         if(flag == 1) 
  124.             flag = -1; 
  125.         else 
  126.         { 
  127.             ++var; 
  128.             flag = 1; 
  129.         } 
  130.     } 
  131.     if(ha[adr].key == key) 
  132.         return adr; 
  133.     else return -1; 
  134.  
  135.  
  136. int DeleteHT2(HashTable ha, int key, int &num ) 
  137.     int adr = 0; 
  138.  
  139.     adr = SearchHT2(ha,key); 
  140.     if(adr != -1) 
  141.     { ha[adr].key = DELKEY; ha[adr].count = 0; --num;  return 1;} 
  142.     else return -1; 
  143.  
  144. void InsertHT2(HashTable ha, int key, int &num) 
  145.     int adr = 0,adr1 = 0, flag = 1, var = 1, count = 1; 
  146.     adr = SearchHT2(ha,key); 
  147.     if(adr != -1) { cout<<"The node is already exitence "<<endl; return;} 
  148.  
  149.     adr1 = adr = key % MAXSIZE; 
  150.     while(ha[adr].key != NULLKEY && ha[adr].key != DELKEY) 
  151.     {   ++count; 
  152.         adr = (adr1 + var * var * flag) % MAXSIZE; 
  153.         if(adr >= MAXSIZE || adr < 0)   { cout<<"fail to insert , not so much space !!! "<<endl; return ;} 
  154.  
  155.         if(flag == 1) 
  156.             flag = -1; 
  157.         else 
  158.         { 
  159.             ++var; 
  160.             flag = 1; 
  161.         } 
  162.     } 
  163.     ++num; 
  164.     ha[adr].key = key; 
  165.     ha[adr].count = count; 
  166.  
  167. void CreateHT2(HashTable ha, ElemType keys[], int len, int &num) 
  168.     int loop1 = 0; 
  169.     for (loop1 = 0; loop1 < MAXSIZE ; ++loop1) 
  170.     { 
  171.         ha[loop1].count = 0; 
  172.         ha[loop1].key = NULLKEY; 
  173.     } 
  174.     for (loop1 = 0; loop1 < len ; ++loop1)   
  175.         InsertHT2(ha,keys[loop1],num);   
  176.  
  177. void CompASL2(HashTable ha, int num) 
  178.     int count = 0; 
  179.     int total = 0, loop1 = 0; 
  180.     for(loop1 = 0; loop1 < MAXSIZE; ++loop1) 
  181.     { 
  182.         total += ha[loop1].count; 
  183.         if(ha[loop1].count != 0) 
  184.             ++count; 
  185.     } 
  186.     if(count != num) { cout<<"Fail to asl"<<endl; return; } 
  187.     cout<<"the find average length is : "<<total * 1.0 /  num<<endl; 
  188.  
  189.  
  190. typedef struct node1 
  191.     ElemType key; 
  192.     struct node1 *next; 
  193. }SNode1; 
  194.  
  195. typedef struct  
  196.     struct node1 *next; 
  197. }HNode; 
  198.  
  199.  
  200. int SearchHT3(HNode ha[], ElemType key) 
  201.     int adr = 0; 
  202.     SNode1 *temp = NULL; 
  203.     adr = key % MAXSIZE; 
  204.  
  205.     if(ha[adr].next == NULL)  return -1; 
  206.     else 
  207.     { 
  208.         temp = ha[adr].next; 
  209.         while(temp != NULL && temp->key != key) 
  210.             temp = temp->next; 
  211.         if(temp == NULL)  return -1; 
  212.         else if(temp->key == key) return adr; 
  213.     } 
  214.  
  215. int DeleteHT3(HNode ha[], int key) 
  216.     int adr = 0; 
  217.     SNode1 *parent = NULL, *desc = NULL; 
  218.     adr = SearchHT3(ha,key); 
  219.  
  220.     if(adr == -1 ) {cout<<"no the element want to delete "<<endl; return -1;} 
  221.     else  
  222.     {   parent = ha[adr].next; 
  223.         desc = ha[adr].next; 
  224.         while(desc != NULL && desc->key != key) 
  225.         { 
  226.             parent = desc; 
  227.             desc = desc->next; 
  228.         } 
  229.         if(desc != NULL && desc->key == key) 
  230.         { 
  231.             parent->next = desc->next; 
  232.             free(desc); 
  233.             return 1; 
  234.         } 
  235.         return -1; 
  236.     } 
  237.  
  238. void InsertHT3(HNode ha[], ElemType key) 
  239.     int adr = 0; 
  240.     SNode1 *temp = NULL, *temp2 = NULL; 
  241.     adr = key % MAXSIZE; 
  242.      
  243.     temp = (SNode1 *)malloc(sizeof(SNode1)); 
  244.     temp->key = key; 
  245.     temp->next = NULL; 
  246.              
  247.     temp2 = ha[adr].next; 
  248.     if(temp2 == NULL) 
  249.     {ha[adr].next = temp; return ;} 
  250.     else 
  251.     { 
  252.         while(temp2->next != NULL)       
  253.             temp2 = temp2->next; 
  254.         temp2->next = temp; 
  255.     } 
  256.  
  257. void CreateHT3(HNode ha[], ElemType keys[], int len) 
  258.     int loop1 = 0; 
  259.     for(loop1 = 0; loop1 < MAXSIZE; ++loop1)     
  260.         ha[loop1].next = NULL;   
  261.  
  262.     for(loop1 =0 ; loop1 < len ; ++loop1)    
  263.         InsertHT3(ha,keys[loop1]);   
  264.  
  265. void Disp(HNode ha[]) 
  266.     int loop1 = 0; 
  267.     SNode1 *temp = NULL; 
  268.  
  269.     for(loop1 =0; loop1 < MAXSIZE; ++loop1) 
  270.     { 
  271.         if(ha[loop1].next != NULL) 
  272.         { 
  273.             temp = ha[loop1].next; 
  274.             while(temp != NULL) 
  275.             { 
  276.                 cout<<temp->key<<' '
  277.                 temp = temp->next; 
  278.             } 
  279.             cout<<endl; 
  280.         }        
  281.     } 
  282.  
  283. void CompASL3(HNode ha[]) 
  284.     int num = 0,total = 0,loop1 = 0,var = 0; 
  285.     SNode1 *temp = NULL; 
  286.  
  287.     for(loop1 = 0; loop1 < MAXSIZE; ++loop1) 
  288.     {    
  289.         var = 0; 
  290.         if(ha[loop1].next != NULL) 
  291.         {   ++num; 
  292.             temp = ha[loop1].next; 
  293.  
  294.             while(temp != NULL) 
  295.             {    
  296.                 ++var; 
  297.                 total += var; 
  298.                 temp = temp->next; 
  299.             } 
  300.         } 
  301.     } 
  302.     cout<<"num is "<<num<<" the find average length is "<<total * 1.0 / num<<endl; 
  303.  
  304. void CompUNASL3(HNode ha[]) 
  305.     int total = 0,loop1 = 0,var = 1; 
  306.     SNode1 *temp = NULL; 
  307.  
  308.     for(loop1 = 0; loop1 < MAXSIZE; ++loop1) 
  309.     {    
  310.         var = 1; 
  311.         if(ha[loop1].next != NULL) 
  312.         {     
  313.             temp = ha[loop1].next; 
  314.             while(temp != NULL) 
  315.             {    
  316.                 ++var;               
  317.                 temp = temp->next; 
  318.             } 
  319.         } 
  320.         total += var; 
  321.     } 
  322.     cout<<"the find average length is "<<total * 1.0 / MAXSIZE<<endl; 
  323.  
  324. #include <iostream> 
  325. using namespace std; 
  326.  
  327.  
  328.  
  329. int BinSearch(int iarr[], int len, int key) 
  330.     int left = 0, right = len -1 , mid = 0; 
  331.  
  332.     while(left <= right) 
  333.     {// cout<<"left is "<<iarr[left]<<"  rigth is "<<iarr[right]<<endl; 
  334.         mid = (left + right ) / 2; 
  335.         if(iarr[mid] == key)  return (mid + 1); 
  336.         else if(iarr[mid] > key) 
  337.         { 
  338.             right = mid -1; 
  339.         }else 
  340.         { 
  341.             left = mid + 1; 
  342.         } 
  343.     } 
  344.     return -1; 
  345.  
  346.  
  347.  
  348. typedef int ElemType; 
  349. typedef struct node 
  350.     ElemType data; 
  351.     struct node *lchild, *rchild; 
  352. }BSTNode; 
  353.  
  354. BSTNode *BSTSearch(BSTNode *bt, int key) 
  355.     BSTNode *temp = NULL; 
  356.     if(bt == NULL)  return NULL; 
  357.     else if(bt->data == key)  return bt; 
  358.     else if(bt->data > key) 
  359.     { 
  360.         return BSTSearch(bt->lchild,key); 
  361.     }else  
  362.     { 
  363.         return BSTSearch(bt->rchild,key); 
  364.     } 
  365.  
  366.  
  367. int BSTInsert(BSTNode *&tree, int key) 
  368.     BSTNode *temp = NULL; 
  369.     if(tree == NULL) 
  370.     { 
  371.         temp = (BSTNode *)malloc(sizeof(BSTNode)); 
  372.         temp->data = key; 
  373.         temp->lchild = NULL; 
  374.         temp->rchild = NULL; 
  375.         tree = temp; return 1;  
  376.     }    
  377.     else if(tree->data > key) 
  378.     { 
  379.         return BSTInsert(tree->lchild,key); 
  380.     }else if(tree->data < key) 
  381.     {   return BSTInsert(tree->rchild, key) ;} 
  382.     else { return 0; }  
  383.  
  384. void CreateBST(BSTNode *&tree, int iarr[], int len) 
  385.     int loop1 = 0; 
  386.     for(loop1 = 0; loop1 < len ; ++loop1) 
  387.         BSTInsert(tree,iarr[loop1]); 
  388.  
  389.  
  390. int BSTDelete(BSTNode *&tree, int key)       //删除排序树中的节点 
  391.     BSTNode *parent = NULL, *desc = NULL, *parent2 = NULL,*temp = NULL;   
  392.  
  393.     parent = tree;    desc = tree; 
  394.     while(desc != NULL && desc->data != key)     //找到要删除的节点 
  395.     {   parent = desc; 
  396.         if(desc->data > key)                                 
  397.             desc = desc->lchild; 
  398.         else if(desc->data < key)                    
  399.             desc = desc->rchild;         
  400.     } 
  401.  
  402.     if(desc == NULL)                        //表示没有要找的节点 
  403.         return 0; 
  404.     else if(desc->lchild == NULL && desc->rchild == NULL)            //找到的节点是叶子节点,即没有左右子树 
  405.     { 
  406.         if(parent->lchild == desc)                                  //直接把它释放即可 
  407.             parent->lchild = NULL; 
  408.         else if(parent->rchild == desc)      
  409.             parent->rchild = NULL; 
  410.          
  411.         free(desc); 
  412.         return 1; 
  413.     }else if(desc->lchild != NULL && desc->rchild == NULL)          //此处表示找到的没有右节点只有左节点,把此节点的左节点接到其双亲节点的左节点上即可 
  414.     {                                                           //此处不用考虑其是不是双亲节点的右节点, 因为其有左节点,无右节点证明,它就是双亲节点的左节点, 因为这是一颗排序树 
  415.         parent->lchild = desc->lchild; 
  416.         free(desc); 
  417.         return 1; 
  418.     }else if(desc->lchild == NULL && desc->rchild != NULL) 
  419.     { 
  420.         parent->rchild = desc->rchild; 
  421.         free(desc); 
  422.         return 1; 
  423.     }else                                               //此处表示其左右节点都存在,处理这种情况,两种方法,1 :把其左子树的最右下节点代替它, 2 :把其右子树最左下节点代替它。 此处用的是第一种方法 
  424.     { 
  425.         parent2 = desc; 
  426.         temp = desc->lchild; 
  427.         while(temp != NULL && temp->rchild != NULL) 
  428.         { 
  429.             parent2 = temp; 
  430.             temp = temp->rchild; 
  431.         } 
  432.         if(parent2->lchild == temp)                   //此处表示上面的while循环没有进行, 因为按理说temp不应该为左节点 
  433.             parent2->lchild = temp->lchild; 
  434.         else if(parent2->rchild == temp) 
  435.             parent2->rchild = temp->lchild; 
  436.  
  437.         temp->rchild = desc->rchild;                //用于代替 
  438.         temp->lchild = desc->lchild; 
  439.          
  440.         if(parent == desc)                          //此处表明找到是根节点的情况 
  441.             tree = temp; 
  442.         else if(parent->lchild == desc)      
  443.             parent->lchild = temp;           
  444.         else         
  445.             parent->rchild = temp; 
  446.         free(desc); 
  447.     } 
  448.     return 1; 
  449.  
  450. void BSTDisp(BSTNode *tree) 
  451.     if(tree != NULL) 
  452.     { 
  453.         BSTDisp(tree->lchild); 
  454.         cout<<tree->data<<' '
  455.         BSTDisp(tree->rchild); 
  456.     } 
  457.  
  458. int BSTInsert2(BSTNode *&tree, int key)            //此函数是插入节点的非递归算法,关键是用到了非递归找到的节点的思想(while循环) 
  459. {                                               //知道插入的节点一定是作为一个叶子节点插入树中的 
  460.     BSTNode *parent = NULL,*desc = NULL, *temp = NULL;   
  461.  
  462.     if(tree != NULL) 
  463.     { 
  464.         desc = tree; 
  465.         while(desc != NULL) 
  466.         { 
  467.             if(desc->data == key) return 0; 
  468.             else if(desc->data > key) 
  469.             { 
  470.                 parent = desc; 
  471.                 desc = desc->lchild; 
  472.             }else 
  473.             { 
  474.                 parent = desc; 
  475.                 desc = desc->rchild; 
  476.             } 
  477.  
  478.         } 
  479.         temp = (BSTNode *)malloc(sizeof(BSTNode)); 
  480.         temp->lchild = temp->rchild = NULL; 
  481.         temp->data = key; 
  482.  
  483.         if(parent->data > key)       
  484.             parent->lchild = temp;       
  485.         else parent->rchild = temp; 
  486.     }else return 0; 
  487.     return 1; 
  488.   
  489. int Height(BSTNode *tree)             //计算根节点的高度 
  490.     int  height1 = 0, height2 = 0; 
  491.     if(tree == NULL)  return 0; 
  492.     else if (tree->lchild == NULL && tree->rchild == NULL) return 1; 
  493.     else  
  494.     { 
  495.         height1 = Height(tree->lchild); 
  496.         height2 = Height(tree->rchild); 
  497.         return height1 > height2 ? height1 + 1 :height2 + 1;        //此处加一是为了计算其本身 
  498.     } 
  499.  
  500. void Compbf(BSTNode *tree)            //此函数通过递归对每个节点进行判断深度 
  501.     int lheight = 0, rheight = 0; 
  502.     if(tree != NULL) 
  503.     { 
  504.         lheight = Height(tree->lchild); 
  505.         rheight = Height(tree->rchild); 
  506.         cout<<tree->data<<" 's bf is "<<lheight - rheight<<endl; 
  507.         Compbf(tree->lchild); 
  508.         Compbf(tree->rchild); 
  509.     } 
  510.  
  511. void JudgeAVL(BSTNode *tree, int &balance, int &h) 
  512. {   int bl,br,hl,hr; 
  513.     if(tree == NULL) { balance = 1; h = 0; } 
  514.     else if(tree->lchild == NULL && tree->rchild == NULL) { balance = 1; h = 1;} 
  515.     else 
  516.     { 
  517.         JudgeAVL(tree->lchild,bl,hl); 
  518.         JudgeAVL(tree->rchild,br,hr); 
  519.         h = (hl > hr ? hl : hr) + 1; 
  520.         if(abs(hl - hr) < 2) 
  521.             balance = bl & br; 
  522.         else 
  523.             balance = 0; 
  524.     } 
  525.  
  526.  
  527. typedef struct tnode1 
  528.     char ch; 
  529.     int count; 
  530.     struct tnode1 *lchild, *rchild; 
  531. }TNode; 
  532.  
  533. void CreateTree(TNode *&tree, char c[]) 
  534.     int loop1 = 0;              char ch = c[loop1]; 
  535.     TNode *temp = NULL , *parent = NULL, *desc = NULL; 
  536.     while(ch != '\0'
  537.     { 
  538.         temp = (TNode *)malloc(sizeof(TNode)); 
  539.         temp->ch = ch;             temp->count = 0;       temp->lchild = NULL;       temp->rchild = NULL; 
  540.         if(tree == NULL) 
  541.         { tree = temp;  } 
  542.         else 
  543.         {    
  544.             parent = NULL;       desc = tree; 
  545.             while(desc != NULL && desc->ch != ch)        //此处一定要先判断desc是否为空 
  546.             {  
  547.                 if(desc->ch > ch) { parent = desc; desc = desc->lchild;} 
  548.                 else { parent = desc; desc = desc->rchild; } 
  549.             } 
  550.             if(desc == NULL && parent != NULL)   
  551.             { 
  552.                 if(parent->ch > ch)  parent->lchild = temp; 
  553.                 else parent->rchild = temp; 
  554.             } 
  555.             else if(desc->ch == ch) { ++desc->count; } 
  556.         } 
  557.         ch = c[++loop1]; 
  558.     } 
  559.  
  560.  
  561. void  Disp( TNode *tree) 
  562.     if(tree != NULL) 
  563.     { 
  564.         Disp(tree->lchild); 
  565.         cout<<tree->ch<<' '<<tree->count<<endl; 
  566.         Disp(tree->rchild); 
  567.     } 
  568.  
  569. #include "find.h" 
  570. #include "hash.h" 
  571. void main() 
  572.     int iarr[10] = {56,67,78,89,98,100,11,23,31,45}; 
  573.     char carr[11] = {"dertdacvbs"}; 
  574.     int num = 0; 
  575.     HashTable ha; 
  576.     HNode ha2[MAXSIZE]; 
  577. //  BSTNode *tree = NULL; 
  578. //  TNode *ttree = NULL; 
  579. //  cout<<"place is : "<<BinSearch(iarr,10,31)<<endl; 
  580. //  CreateBST(tree,iarr,10); 
  581. //  BSTDisp(tree);  cout<<endl; 
  582. //  BSTInsert2(tree,65); 
  583. //  BSTDisp(tree);cout<<endl; 
  584. //  cout<<"root->data  "<<tree->data<<endl; 
  585. //  cout<<BSTSearch(tree,67)->data<<endl; 
  586. //  BSTDelete(tree,45); 
  587. //  Compbf(tree); 
  588. //  BSTDisp(tree);cout<<endl; 
  589.  
  590. //  CreateTree(ttree,carr); 
  591. //  Disp(ttree); 
  592.  
  593. //  CreateHT(ha,iarr,10,num); 
  594. //  DispHT(ha); 
  595. /*  DeleteHT( ha,56, num) ; 
  596.     DispHT(ha); 
  597.     DeleteHT( ha,100, num) ; 
  598.     DispHT(ha); 
  599.     InsertHT(ha, 108,num); 
  600.     DispHT(ha);     */ 
  601. //  CompASL(ha,num); 
  602. //  CompUNASL(ha); 
  603. /* 
  604.     CreateHT2(ha,iarr,10,num); 
  605.     DispHT(ha);   cout<<"num is "<<num<<endl; 
  606.     InsertHT2(ha,14,num); 
  607.     DispHT(ha);    cout<<"num is "<<num<<endl; 
  608.     DeleteHT2(ha,78,num); 
  609.     DispHT(ha);    cout<<"num is "<<num<<endl; 
  610.     CompASL2(ha,num); 
  611.     */ 
  612.  
  613.     CreateHT3(ha2,iarr,10); 
  614.     Disp(ha2);      cout<<endl; 
  615.     InsertHT3(ha2,16); 
  616.     Disp(ha2);      cout<<endl; 
  617.     DeleteHT3(ha2,100); 
  618.     Disp(ha2);      cout<<endl; 
  619.     CompASL3(ha2); 
  620.     CompUNASL3(ha2);