195 : check if the linked list is sorted or not

PHOTO EMBED

Wed May 24 2023 07:20:21 GMT+0000 (Coordinated Universal Time)

Saved by @saakshi #c++

int isSorted(struct Node *p){
  
  x= INT_MIN;

  while(p!=NULL){
    if(p->data<x)
      return false;
    x=p->data;
    p=p->next;
  }
  return true;
}
content_copyCOPY