text: #ifndef LAB0_QUEUE_H
  #define LAB0_QUEUE_H
  
  /*
   * This program implements a queue supporting both FIFO and LIFO
   * operations.
   *
   * It uses a singly-linked list to represent the set of queue elements
   */
  
  #include <stdbool.h>
  #include <stddef.h>
  
  /* Data structure declarations */
  
  /* Linked list element (You shouldn't need to change this) */
  typedef struct ELE {
      /* Pointer to array holding string.
       * This array needs to be explicitly allocated and freed
       */
      char *value;
      struct ELE *next;
  } list_ele_t;
  
  /* Queue structure */
  typedef struct {
      list_ele_t *head; /* Linked list of elements */
      list_ele_t *tail; /* Store the ptr of tail node */
      int size;
  } queue_t;
  
  /* Operations on queue */
  
  /*
   * Create empty queue.
   * Return NULL if could not allocate space.
   */
  queue_t *q_new();
  
  /*
   * Free ALL storage used by queue.
   * No effect if q is NULL
   */
  void q_free(queue_t *q);
  
  /*
   * Attempt to insert element at head of queue.
   * Return true if successful.
   * Return false if q is NULL or could not allocate space.
   * Argument s points to the string to be stored.
   * The function must explicitly allocate space and copy the string into it.
   */
  bool q_insert_head(queue_t *q, char *s);
  
  /*
   * Attempt to insert element at tail of queue.
   * Return true if successful.
   * Return false if q is NULL or could not allocate space.
   * Argument s points to the string to be stored.
   * The function must explicitly allocate space and copy the string into it.
   */
  bool q_insert_tail(queue_t *q, char *s);
  
  /*
   * Attempt to remove element from head of queue.
   * Return true if successful.
   * Return false if queue is NULL or empty.
   * If sp is non-NULL and an element is removed, copy the removed string to *sp
   * (up to a maximum of bufsize-1 characters, plus a null terminator.)
   * The space used by the list element and the string should be freed.
   */
  bool q_remove_head(queue_t *q, char *sp, size_t bufsize);
  
  /*
   * Return number of elements in queue.
   * Return 0 if q is NULL or empty
   */
  int q_size(queue_t *q);
  
  /*
   * Reverse elements in queue
   * No effect if q is NULL or empty
   * This function should not allocate or free any list elements
   * (e.g., by calling q_insert_head, q_insert_tail, or q_remove_head).
   * It should rearrange the existing ones.
   */
  void q_reverse(queue_t *q);
  
  /*
   * Sort elements of queue in ascending order
   * No effect if q is NULL or empty. In addition, if q has only one
   * element, do nothing.
   */
  void q_sort(queue_t *q);
  
  void q_merge(queue_t *left_queue, queue_t *right_queue, queue_t *q);
  bool e_compare(list_ele_t *element_a, list_ele_t *element_b);
  #endif /* LAB0_QUEUE_H */
  