CSClubIIITDM-org / bughunt-2024

Repo for BugHunt vashisht2024
0 stars 35 forks source link

[ABC] c/c++ 10 #199

Open Mahagowri opened 8 months ago

Mahagowri commented 8 months ago

b'\x04\xe6\xf4\x89 \xb4\xf3\xad\xab\t \xbc\xec\x84(\xe5b\xcdcg\x96bH9a,\x8e\xa7m\xb8\x16\xfa&<\xd2\x14\xfa\xf7%8m\xb5\xc2\xcc![\xc3r\xe4\x90\x8bk\xa3\xe4t\x0c$\xa2f\xce(\x9c\xea]b\x96(\x89\xaf"\xdf\xacD\xf8I\x8b2\xeacx\xdf\x0b\xfc;QG\xf5\xb59C\xf2?\x9e9\xe2\xa3\xb8\x9e\x17IE\xb7/\x15\xe3\xd62\xcd{\x92\xa0\xa4\\xf7\x1b\x96\xaa\xfb;0\xb9OR\\xe9S\r\x0f'

b'gAAAAABl9SzFtNG2xQ7no98IeSCJZrqBWRWXY-V3uTk4qH0-fa47ScIT-ZRpWCw9GyRHwoDavlLIbf6KheSTR3S7elwYs4urkbuSIKjhQXEIhse_ZpqkFMfm4DR8IuNXSaA_hHjz1gbpfKGm9vf6T54bK0he_HqvvJXijs_pobuKA7130BODk_d-HMxfpgmqtd1QHvGjwbR1rUpub34xs8f4wQJNcf6Ih-rjaGs2xBQsr2TK4NepUromjGdUmBUKjYfLsG2Nplen-u37GQI-N7W8UKYbNNzyI29dLQRr-UoPFdLzB9YmbCwaAsxg-12pA0Oss3Sl3K9XJ5q5QBCWioAC0HKXrdR7P1VtBCp1do1oCNJO0qIgnU0zoewIkTJBlt-var7GmA5P48XfMAH3u-K7SX5abh_e2VyhxEdgO7IZzKXOz48tP98gl0GaAkYi7GJE-rxwmVF-bGPieI0Q_GZA3-ghON9OZJWyULycTdrsyGEHZl8-F7Gk6o84UQOg0WzajVWAccPR1EUf17_cdFN4zxRigCNK7-7_pawGbMV7OcDCECKhkpvus4raxuTDlnPHl3QzZKuSh0hhdyoE0aBz3wtsKQJxjdcKpfm8MJnJqblBKOQlHpPHmrzTw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ftOo2QAGHzMSnEECnuDTCgAJoWoj7hwYriiMgvotf3odYCuZH8O4Cy3N1yiSOFqV0r1tb-cj-A5q0BBIPX-WCUZDcXQ1ksXZlpyInrG5ovRRrdTTERVfKaPxQZDPrVaxa71NomMxEJWy3Syyemppkb4GI7M2LR1LMXl-GFCk-OX_0Q1lbGiVBpb-dRH3rg7TiLXqnwl0CpceVgO9qMJl3WLWcQBIpAq2P3IYugkhvQWZYzclfewuAx7qOCTfpM7we9Qesj1M-Td_0avAeXDnsPlzWY69WKwuQ7-ML8SE2UmGT8XZ6B6ySV75KeuDNy5aHrtu2k-nj60PhExoZ3lKkU_RR230M1fmH6w_SwgNiWoADGeU9-9ygjF27e6HGVurFW9GFgG6M1R38Svtr9VZeriOsct9wrqVcMaoaSZJ5zNnOw-UJFXpWCPWVZx70sy6DJQ5Q=='

bughunt-bot[bot] commented 8 months ago

Team Name: ABC File Name: c/c++ 10 Line Number: [43] Bug Description: there is no condition for the x Solution: //CPP program to implement circular linked list

#include<bits/stdc++.h>
using namespace std;
struct node{            //defining the structure of the node
    int data;
    struct node *next;
};
//class definition for circular linked list
class CLL{       
private:
    struct node *tail;
public:
    CLL(){
        this->tail=NULL;    //constructor to initialize the tail pointer
    }
    void insert(int,bool);
    void deletenode();    //member function
    void display();
    ~CLL(){         //destructor to delete the list
        struct node *ptr=tail->next;
        while(ptr!=tail){
            struct node *temp=ptr;
            ptr=ptr->next;
            delete temp;
    }
    delete ptr;
}

}; //member function definitions void CLL::insert(int a,bool x) { struct node *temp=new struct node; temp->data=a; temp->next=nullptr; if(tail==nullptr){ tail=temp; tail->next=temp; return; } temp->next=tail->next; tail->next=temp; if(x==True){ tail=temp; } }

//delete function to delete at end void CLL::deletenode() { if(tail==nullptr) { cout << "Invalid, List is already empty" << endl; return; } if(tail->next==tail) { struct node ptr=tail; tail=nullptr; delete ptr; return; } struct node temp=tail; struct node *ptr=tail->next; while(ptr->next!=tail) ptr=ptr->next; ptr->next=tail->next; tail=ptr; delete temp; return; }

//display function to display the list void CLL::display() { if (tail==nullptr) { cout << "List is empty" << endl; return; } struct node *ptr=tail->next; while(ptr->next!=tail->next) { cout << ptr->data << " -> "; ptr=ptr->next; } cout << ptr->data << endl; }

int main(){ int choice=1;CLL list1; //menu driven program do{ cout << "1.Insert"<<endl; cout << "2.Delete"<<endl; cout << "3.Display"<<endl; cout << "4.Exit the menu"<<endl; cout << "Enter your choice: "; cin>> choice; int a,b;bool x; switch(choice) { case 1:{ cout << "Enter the element to be inserted: "; cin>>a; cout << "0. Insert the element at beginning"<<endl; cout << "1. Insert the element at end"<<endl; cout << "Choice: "; cin>>choice; if(choice==0 || choice==1) //inserting at beginning or end { x=choice; list1.insert(a,x); choice=-1; } else{ cout << "Invalid choice" << endl; } break; } case 2:{ //deleting at end list1.deletenode(); break; } case 3:{ //displaying the list cout << "List"<<endl; list1.display(); break; } case 4:{ //exiting the menu cout << "Exiting the menu..."<<endl; } default: cout << "Invalid choice"<<endl; break; } }while(choice!=4); }

bughunt-bot[bot] commented 8 months ago

Bug Hunt Evaluation: Answer: ((131, 21),) Correctness: 0/2 Points: 0/100