Skip to main content

Transfer google play balance to Paytm, PhonePe, Google Pay or any UPI linked bank account.

To transfer google play balance, opinion rewards or gift cards to PayPal, Paytm, PhonePe, Google Pay or any UPI ID linked bank account , you can use QxCredit :Rewards Convertor app which is available on google play store: You will get back 80% of the google play balance. App link:  https://play.google.com/store/apps/details?id=qxcoding.qx_credit_reboot Follow these steps to transfer your play balance to paypal or UPI: 1) download app from play store. 2) login with your google account and phone number. 3) choose a token amount which you want to convert/transfer. 4) Enter your payout details.(UPI ID or PayPal Email) 5) wait for an acknowledgement mail form qxcredit containing information about your purchased token. 6) you will receive the amount within 3 days. 7) if you face any issues you can raise a query on website: https://qx-credit.web.app/#/contact_support About app: Introducing QxCredit : Rewards Converter Convert /Transfer or Exchange your Google Play Balance and opini...

Linked List Implementation ( C ++ ) Program


Linked list is a linear collection of data elements, whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence
Linked list is an Abstract Data Type ( ADT ).



Node definition ( Structure ) 
struct node{
     int num;
     node* next;
 };
The num variable stores the data given by the user and the pointer (next) stores the address of the next element present in the linked list.


Operations 
void insert_beg(int value);
void insert_end(int value);
void insert_inBetween();
node* find(int cvalue,int p=0);
void input_ll();
void display();
void delete_ll();                                                                          void delete_node(); 
Function definitions

1) Inserting in beginning 
void insert_beg(int value){
     node* n=new node;
     n->num=value;
     if(first==NULL){
         n->next=NULL;
         first=n;
     }
     else{
         n->next=first;
         first=n;
     }
 }
the above function ,when called creates a new node and stores the value passed to it in num (variable) ,now the function checks if the list is empty and if it is empty then it is simply marked as the first element in the linked list.
if the list is not empty then the pointer (next ) is assigned to the first element address and the marker (first) is given to current element.

2) Insertion at end 
void insert_end(int value){
     node* n=new node;
     n->num=value;
     n->next=NULL;
     if(first==NULL)
         first=n;
     else{
         node* temp=first;
         while(temp->next!=NULL)
             temp=temp->next;
         temp->next=n;
     }
 }
This function is called when an element is to be stored in the last position of a linked list.
if the list is empty , we will add the element as first in the list.
if not then , we have to traverse the list first and stop when a node's (temp) next value is NULL and then point the node's (temp) next value to the node which is to be inserted.

3) Insertion in between two nodes 
void insert_inBetween(){
 int cvalue,value;
 cout<<"Enter the value after which you want to insert the new node"<<endl;
 cin>>cvalue;
 cout<<"enter the value of new node: ";
 cin>>value;
 cout<<endl;
 node *n,*prev;
 n->num=value;
 if(prev=find(cvalue,0)){
  n->next = prev->next;
  prev->next=n;
  cout<<"node inserted succesfully";
 }
 else{
  cout<<"Node value not found";
 }
}
for performing the insertion after an element given by the user , we need to know the location of the node after which it is to be inserted, for this another function (find()) will be called which will return the address of the node after which we have to insert the new node.
the function ( find() ) accepts two arguments value and the relative position of node (-1,0,1).
-1 : return the previous node
0 : return the current node
1 : return the next node

Definition of function node* find(int,int)
node* find(int cvalue,int p){
 node* temp=first;
 node* prev;
 prev=temp;
 while(temp){
  
  if(temp->num==cvalue){
   if(p==-1)
    return prev;
   if(p==0)
    return temp;
   if(p==1)
    return temp->next;
  }
  prev=temp;
  temp=temp->next;
 }
 return NULL;
}
 
Now, after finding the location of node we just have to assign the current node's next value to the node after (prev) (the node where the value given by the user is stored ) .
 n->next = prev->next;
 prev->next=n;                            cout<<"node inserted successfully";
and then link the new node (current) address to the prev->next to complete the joining of linked list.

4) Taking input from the user 
 void input_ll(){
 int tvalue,nl;
 cout<<"Enter number of members in Linked List\n";
 cin>>nl;
 cout<<endl<<"Enter Members"<<endl;
 for(int i=0;i<nl;i++){
  cin>>tvalue;
  if(T) insert_end(tvalue);
  else {insert_beg(tvalue);}
 }
 T=1;
}
The above function is made to take input values from the user and to call the insertion function:
void insert_beg(int value);
void insert_end(int value);
for adding nodes ( elements ) to the linked list.
The variable stores 1 by default ,to insert nodes in the end in sequential manner until the user decides to add the nodes in beginning of linked list.

5) Display the linked list 
void display(){
 cout<<"the linked list is as follows:"<<endl;
 node* tdis=first;
 while(tdis){
  cout<<tdis->num<<" ";
  tdis=tdis->next;
 }
}
The above function will traverse the linked list until it meets a location ( pointer ) which stores NULL , and display the value of num stored in each node.



The below functions for deleting node are very similar to insertion of a node. The functions definitions are given below .
6) Deleting node from beginning 

void delete_beg(){
 if(first==NULL){
  cout<<"Empty list\n";
 }
 else{
  node* temp=first;
  first=first->next;
  delete(temp);
 }
}
7) Deleting node from end
void delete_end(){
 if(first==NULL)
  cout<<"Empty list\n";
 else{
  node *temp=first;
  while(temp->next->next)
   temp=temp->next;
  delete(temp->next);
  temp->next=NULL;
 }
}
8) Deleting node from in between ( By searching for a specific node value )
void delete_node(){
 int dValue;
 cout<<"Enter the value you want to delete; ";
 cin>>dValue;
 if(first->num==dValue){
  node* t1=first;
  first=first->next;
  delete(t1);
 }
 else{
  node* prev=find(dValue,-1);
  node* dNode=prev->next;
  if(prev!=NULL){
   prev->next=dNode->next;
   delete(dNode);
  }
  else
   cout<<"Value not found"<<endl;
 }
}
  
Here ,the function find() is used again with parameter ( -1 ) ,so that it returns the address of the node preceding the node which contains the value to be searched .

FOR EXECUTABLE CODE : CLICK HERE :



SOURCE CODE ( C++)

/* Made by : Jatin yadav ( QxCoding )
 LINKED LIST OPERATIONS
*/
#include <iostream>
using namespace std;
struct node{
 int num;
 node* next;
};
int T=1;
node* first=NULL;
void clrscr(){
 for(int i=0;i<5;i++)
  cout<<endl;
}
void insert_beg(int value);
void insert_end(int value);
void insert_inBetween();
node* find(int cvalue,int p=0);
void input_ll();
void display();
void delete_beg();
void delete_end();
void delete_ll();
void delete_node();


int main(int argc, char *argv[]) {
 
 int choice;
 while(1){
 clrscr();
 cout<<"Enter the choice :"<<endl;
 cout<<"1)Insertion at begining"<<endl
  <<"2)Insertion at end"<<endl
  <<"3)Insertion after any given value"<<endl
  <<"4)Display Linked list"<<endl
  <<"5)Delete specific node"<<endl
  <<"6)Delete from end"<<endl
  <<"7)Delete from beginning"<<endl
  <<"8)Delete All nodes"<<endl
  <<"0)Exit"<<endl<<endl;
 cin>>choice;
 switch(choice){
  case 1: T=0;
  case 2: clrscr();input_ll();break;
  case 3: clrscr();insert_inBetween();break;
  case 4: clrscr();display();break;
  case 5: clrscr();delete_node();break;
  case 6: clrscr();delete_end();break;
  case 7: clrscr();delete_beg();break;
  case 8: clrscr();delete_ll();break;
  case 0: goto xit;
  default: cout<<"Invalid Input"<<endl;
 }
 }
 xit:
 delete_ll();
 
 return 0;
}



void insert_beg(int value){
 node* n=new node;
 n->num=value;
 if(first==NULL){
  n->next=NULL;
  first=n;
 }
 else{
  n->next=first;
  first=n;
 }
}
void insert_inBetween(){
 int cvalue,value;
 cout<<"Enter the value after which you want to insert the new node"<<endl;
 cin>>cvalue;
 cout<<"enter the value of new node: ";
 cin>>value;
 cout<<endl;
 node *n,*prev;
 n->num=value;
 if(prev=find(cvalue,0)){
  n->next = prev->next;
  prev->next=n;
  cout<<"node inserted succesfully";
 }
 else{
  cout<<"Node value not found";
 }
}
node* find(int cvalue,int p){
 node* temp=first;
 node* prev;
 prev=temp;
 while(temp){
  
  if(temp->num==cvalue){
   if(p==-1)
    return prev;
   if(p==0)
    return temp;
   if(p==1)
    return temp->next;
  }
  prev=temp;
  temp=temp->next;
 }
 return NULL;
}
 
 
void insert_end(int value){
 node* n=new node;
 n->num=value;
 n->next=NULL;
 if(first==NULL)
  first=n;
 else{
  node* temp=first;
  while(temp->next!=NULL)
   temp=temp->next;
  temp->next=n;
 }
}
void input_ll(){
 int tvalue,nl;
 cout<<"Enter number of members in Linked List\n";
 cin>>nl;
 cout<<endl<<"Enter Members"<<endl;
 for(int i=0;i<nl;i++){
  cin>>tvalue;
  if(T) insert_end(tvalue);
  else {insert_beg(tvalue);}
 }
 T=1;
}

 
void display(){
 cout<<"the linked list is as follows:"<<endl;
 node* tdis=first;
 while(tdis){
  cout<<tdis->num<<" ";
  tdis=tdis->next;
 }
}

void delete_ll(){
 node* temp=first;
 if(first==NULL){
  cout<<"Empty list\n";
  return;
 }
 while(first=first->next){
  delete(temp);
  temp=first;
 }
 delete(temp);
}
void delete_beg(){
 if(first==NULL){
  cout<<"Empty list\n";
 }
 else{
  node* temp=first;
  first=first->next;
  delete(temp);
 }
}

void delete_end(){
 if(first==NULL)
  cout<<"Empty list\n";
 else{
  node *temp=first;
  while(temp->next->next)
   temp=temp->next;
  delete(temp->next);
  temp->next=NULL;
 }
}

void delete_node(){
 int dValue;
 cout<<"Enter the value you want to delete; ";
 cin>>dValue;
 if(first->num==dValue){
  node* t1=first;
  first=first->next;
  delete(t1);
 }
 else{
  node* prev=find(dValue,-1);
  node* dNode=prev->next;
  if(prev!=NULL){
   prev->next=dNode->next;
   delete(dNode);
  }
  else
   cout<<"Value not found"<<endl;
 }
}
if any doubts or queries please comment 🙂

Comments

Popular posts from this blog

Transfer google play balance to Paytm, PhonePe, Google Pay or any UPI linked bank account.

To transfer google play balance, opinion rewards or gift cards to PayPal, Paytm, PhonePe, Google Pay or any UPI ID linked bank account , you can use QxCredit :Rewards Convertor app which is available on google play store: You will get back 80% of the google play balance. App link:  https://play.google.com/store/apps/details?id=qxcoding.qx_credit_reboot Follow these steps to transfer your play balance to paypal or UPI: 1) download app from play store. 2) login with your google account and phone number. 3) choose a token amount which you want to convert/transfer. 4) Enter your payout details.(UPI ID or PayPal Email) 5) wait for an acknowledgement mail form qxcredit containing information about your purchased token. 6) you will receive the amount within 3 days. 7) if you face any issues you can raise a query on website: https://qx-credit.web.app/#/contact_support About app: Introducing QxCredit : Rewards Converter Convert /Transfer or Exchange your Google Play Balance and opini...

What is AI (Artificial Intelligence )? and its characteristics

Definition : Artificial intelligence  (AI) is the ability of a  computer program  or a  machine  to think and learn. It is also a field of study which tries to make computers "smart". They work on their own without being encoded with commands. Types of AI : REACTIVE MACHINES:  The most basic type of AI is purely reactive ,it does not store any memory of past or predict ( calculate ) future happenings. This type of AI is only applicable to specific applications and the principle is choosing the best decision among several options. examples: Deep Blue, IBM’s chess-playing supercomputer LIMITED MEMORY :  this type 2 kind of AI machines are distinct from reactive machine in such a way that it can make optimum decisions based on the past information ( data ). examples: self driving cars. THEORY OF MIND:  The understanding that people,creatures and objects can have thoughts or emotions which effect their own behavior. ...

How to convert google play balance to paypal or UPI [2024]

If your google account contains play balance which you might have earned from google competitions, opinion rewards or gift vouchers, you can transfer the amount to paypal account or any UPI linked bank account.  For transferring the play balance you need to follow 3 simple steps :  1) Download QxCredit app from google play store:                                 2) Purchase a token of your choice by entering the payout details :            3) View your purchase in my tokens section and wait for 72 hours for the transaction to be verified and processed. The below video demonstrates the process of purchasing a token of your choice to convert play balance: After purchasing token you will also receive a confirmation mail from QxCredit regarding the purchased token information. You can also view your purchased token on QxCredit website:...