Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct node{
- int data;
- struct node* next;
- }node;
- node* createNode(int input){
- /*
- 노드포인터 변수 temp 에 Node를 위한 공간을 할당받아서 주소를 저장함 ( malloc 이용 )
- temp의 data에는 받은 argument를 넣어주고
- temp의 next은 NULL
- 그리고 할당받은 공간의 주소를 return 해줌
- */
- node* temp;
- }
- void showLinkedList(node* head){
- /*
- LinkedList의 head를 받아서 head부터 끝까지 Data들을 출력해줌
- Hint.
- head부터 node안의 data를 출력한다.
- 언제까지 출력 해야할까?
- While 이용하면 편함
- */
- }
- int main(int argc, char const *argv[]){
- /*
- 1) createNode() 작성
- 2) ShowLinkedList() 작성
- 3) Main() 작성:
- createNode() 함수를 이용해서 node를 만들고
- head
- 5 -> 4 -> 3 -> 2 -> 1
- 모양으로 저장 LinkedList를 만들어라
- Test)
- showLinkedlist(head);
- ----------------------
- output
- 5 4 3 2 1
- */
- node* head;
- // Code HERE
- showlinkedList(head);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement