Beispiel #1
0
void collect_particles(struct PList * p)
{
  LINKLIST ll;
  make_linklist(&ll, Particles.nP, 50, Particles.Pos, GetArrPos, 0);
  p->np=Particles.nP;
  p->PIndex=linklist_search_sphere(&ll, 500./LUNIT, CoM, &p->np);
  printf("Found %d particles\n", p->np);
  free_linklist(&ll);
}
Beispiel #2
0
int main()
{
int num = 10,k = 0;
struct nodes *head, *p;
printf("Enter the value of k \n");
scanf("%d",&k);
if(k < 0)
{
printf("Incorrect Input \n");
return 0;
}
head = make_linklist(num);
p = head;
//display_list(p);
//printf("Now Reversing\n");
if(k)
head = KReverse(head, k);
//reverse(head);
//sort(head);

display_list(head);
return 0;
}