home *** CD-ROM | disk | FTP | other *** search
/ ftp.disi.unige.it / 2015-02-11.ftp.disi.unige.it.tar / ftp.disi.unige.it / pub / .person / CataniaB / teach-act / esempi / Comp-Sep / stack.c < prev    next >
C/C++ Source or Header  |  1997-04-19  |  436b  |  35 lines

  1. /* Tipo di dato stack:  */
  2. #include<stdio.h>
  3. #include "stack.h"  /* include a sua volta "list.h" */
  4.  
  5. bool is_empty_stack(stack *s) 
  6.  { 
  7.    is_empty(s); 
  8.   }
  9.  
  10. void init_stack(stack *s)
  11.  {
  12.    init(s);
  13.  } 
  14.  
  15. void top(element *x,element *y,stack *s)
  16.  { 
  17.    first(x,y,s);
  18.  }
  19.  
  20. void push(element x,element y,stack *s)
  21.  { 
  22.    insert_head(x,y,s);
  23.  }
  24.  
  25. void pop(stack *s)
  26.  { 
  27.    delete_head(s);
  28.   } 
  29.  
  30. void print_stack(stack *s)
  31.  {
  32.    print(s);
  33.  }
  34.  
  35.