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...
To reverse a given linked list ,we have to point the next (link) of each node to its previous node(ie: the node which is pointing to it.)
for that we will maintain three pointers :
1) prev : will point to the node which is pointing to the current node.
2) cur : will point to the node in which we have to change the next(link) to the previous node.
3) next: in the process of changing the cur->next to prev the cur->next will be lost so to store the address of cur->next we use next pointer.
Node definition:
typedef struct node{ int val; struct node* next; }* node;as given above the node contains two members value and a pointer pointing to its own datatype which will store the address of another node .
reverse_ll(node *first) : function :
void reverse_ll(node* first){
node prev=NULL;
node cur=(*first);
node next=NULL;
while(cur){
next=cur->next;
cur->next=prev;
prev=cur;
cur=next;
} *first=prev;
}
for reversing a linked list the above function is called by passing the first node of the linked list.the function maintains three node pointers previous,current,next.
1) the next pointer stores the address of the cur->next node so that we can change cur->next value.
2) then the cur->next is pointed to its previous node.
3) and finally the previous becomes current node and the current becomes next and this same is repeated until current points to NULL .
OUTPUT:
SOURCE CODE:
// https://www.qxcoding.com/
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int val;
struct node* next;
}* node;
node create(int val){
node temp;
if(!(temp=(node)malloc(sizeof(struct node)))){
printf("not enough memory available\n");
exit(0);
}
temp->val=val;
temp->next=NULL;
return temp;
}
void push(node* first,int val){
node nt=create(val);
if(!(*first)){
//printf("empty linked list\n");
*first=nt;
}
else{
nt->next=*first;
*first=nt;
}
}
node create_ll(){
int s,num;
node first=NULL;
printf("Enter elements to be inserted \n");
scanf("%d",&s);
printf("Enter values\n");
for(int i=0;ival);
first=first->next;
}
printf("\n");
}
void delete_ll(node first){
if(first==NULL)
return;
delete_ll(first->next);
free(first);
}
void reverse_ll(node* first){
node prev=NULL;
node cur=(*first);
node next=NULL;
while(cur){
next=cur->next;
cur->next=prev;
prev=cur;
cur=next;
} *first=prev;
}
int main(){
node first=create_ll();
printf("The origlinal linked list is: \n");
display_ll(first);
printf("Reversed linked list is\n");
reverse_ll(&first);
display_ll(first);
delete_ll(first);
first=NULL;
printf("Memory deallocated succesfully\n\n");
return 0;
}
if any doubts or queries please comment
Comments
Post a Comment