title: priority queue segmentation fault
body: <p>I am using a priority queue with a double as the priority. I am guessing this is the cause of the issues. I used these numbers first with no issues.</p>
  
  <p>34.365681
  34.481879
  34.539832
  36.715120</p>
  
  <p>I then used these numbers and had a segmentation fault.</p>
  
  <p>45.411042
  40.481879
  37.702110
  38.951187</p>
  
  <pre><code>struct PRIORITYQUEUE
      {
      int x_pq; 
      int y_pq;
      double heuristic_pq;
      int priority;
      int info;
      struct PRIORITYQUEUE *next;
  }*start, *q, *temp, *new;
  
  typedef struct PRIORITYQUEUE *N;
  
  void insert(int x, int y, double heuristic)
  {
  
      int item; 
      double itprio;
      //new = ( N* ) malloc( sizeof( N ) );
      new = malloc( sizeof( N ) );
  
      itprio = heuristic;
      new-&gt;x_pq = x;
      new-&gt;y_pq = y;
      new-&gt;heuristic_pq = itprio;
  
      if ( start == NULL || itprio &lt; start-&gt;heuristic_pq )
      {
          new-&gt;next = start;
          start = new;
      }
      else
          {
              q = start;
              while ( q-&gt;next != NULL &amp;&amp; q-&gt;next-&gt;heuristic_pq &lt;= itprio )
                  q = q-&gt;next;
  
              new-&gt;next = q-&gt;next;
              q-&gt;next = new;
          }
  }
  
  void del()
  {
      if ( start == NULL )
      {
           printf( "\nQUEUE UNDERFLOW\n" );
      }
      else
      {
      new = start;
      printf( "\nDELETED ITEM IS %d\n", new-&gt;info );
      start = start-&gt;next;
      free( start );
  
      }
  
  }
  
  void display()
  {
      temp = start;
      if ( start == NULL )
          printf( "QUEUE IS EMPTY\n" );
  
      else
      {
          printf( "QUEUE IS:\n" );
  
          while ( temp != NULL )
          {
              printf( "\t x is %d y is %d[heuristic=%lf] \n", temp-&gt;x_pq, temp-&gt;y_pq, temp-&gt;heuristic_pq );
              temp = temp-&gt;next;
          }
       }
  }
  </code></pre>