MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

GeeksForGeeks/Palindrome_Linked_List/Solution.cpp:18–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16bool isPalindrome(Node *head);
17
18int main()
19{
20
21 int T,i,n,l,firstdata;
22 cin>>T;
23 while(T--)
24 {
25 struct Node *head=NULL, *tail=NULL;
26 cin>>n;
27 cin>>firstdata;
28 head=new Node(firstdata);//Creating a new node
29 tail=head;
30
31 //Inserting the new node into the linked list
32 for(i=1;i<n;i++)
33 {
34
35 cin>>l;
36 tail->next=new Node(l);
37 tail=tail->next;
38 }
39 cout<<isPalindrome(head)<<"\n";
40
41 }
42 return 0;
43}
44
45void reverse(struct Node**);
46bool compareLists(struct Node*, struct Node*);

Callers

nothing calls this directly

Calls 1

isPalindromeFunction · 0.85

Tested by

no test coverage detected