1. Array and Ll Notes
1. Array and Ll Notes
#include <stdio.h>
#include <stdlib.h>
typedef struct Node {
int data;
struct Node *next;
} Node;
int main() {
second->data = 20;
first->next = second;
second->next = third;
third->next = NULL;
printf("Linked List: "); Linked List: 10 20 30
Node* temp = first;
while(temp) {
printf("%d ", temp->data);
temp = temp->next;
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct Node {
int coeff;
int exp;
struct Node * next;
}* poly = NULL;
void create() {
struct Node * t, * last = NULL;
int num, i;
while (p) {
printf("+ %dx%d ", p -> coeff, p -> exp);
p = p -> next;
}
printf("\n");
}
while (p) {
val += p -> coeff * pow(x, p -> exp);
p = p -> next;
}
return val;
}
int main() {
int x;
create();
Display(poly);