pa10.h 628 B

123456789101112131415161718192021222324252627
  1. #ifndef PA10_H
  2. #define PA10_H
  3. // ----------------------------------- Stack (Linked List)
  4. typedef struct list_node_t {
  5. int value;
  6. struct list_node_t * next;
  7. } ListNode;
  8. typedef struct stack_t {
  9. ListNode * list;
  10. } Stack;
  11. Stack * Stack_create();
  12. void Stack_destroy(Stack * stack);
  13. int Stack_isEmpty(Stack * stack);
  14. int Stack_popFront(Stack * stack);
  15. void Stack_pushFront(Stack * stack, int value);
  16. // ----------------------------------- Stack Sort...
  17. void stackSort(int * array, int len);
  18. // ----------------------------------- Generating
  19. int isStackSortable(int * array, int len);
  20. void genShapes(int n);
  21. #endif