Monthly Archives: March 2011

Stack and Queue

#include <stdio.h> #include <stdlib.h> struct node{ int data; struct node *p; }; void push(struct node **s,int nilai){ struct node *temp; temp = (struct node*)malloc(sizeof(struct node)); temp->data = nilai; temp->p = *s; *s = temp; } void pop(struct node **s){ struct … Continue reading

Posted in Uncategorized | 2 Comments

Coding buat Doubly linked list

#include #include struct node{ struct node *prev; int data; struct node *next; }; void tambahdiawal(struct node **s,int nilai){ struct node *temp; temp = (struct node *) malloc(sizeof(struct node)); temp->prev = NULL; temp->data = nilai; temp->next = *s; (*s)->prev = temp; … Continue reading

Posted in Uncategorized | Leave a comment