Guest User

Untitled

a guest
Jan 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. bool LList :: search(short x , Node* p)const{
  2.  
  3. if(p == nullptr){
  4. return false;
  5. }
  6. if(p -> item == x){
  7. return true;
  8. }
  9. search(x,p->next); // program crashes if return is used here
  10. }
  11.  
  12. bool LList :: search(short x) const{
  13. return search(x,head);
  14. }
Add Comment
Please, Sign In to add comment