Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. ...CODE...
  2.  
  3. int main(void)
  4. {
  5. int data;
  6. int n = 5;
  7. priorityQueue root;
  8. root.count = 0;
  9.  
  10. push(&root, 10);
  11. push(&root, 20);
  12. push(&root, 30);
  13. push(&root, 40);
  14. push(&root, 50);
  15. // PUSH 로 차례로 10 20 30 40 50 값을 추가했습니다.
  16.  
  17. for(int i = 0; i < n; i++)
  18. {
  19. int data = pop(&root);
  20. // POP 맨 처음값을 하나씩 추출하여 값을 출력하도록 합니다.
  21.  
  22. printf("%d ", data);
  23. // 값을 출력 합니다.
  24. }
  25.  
  26. system("pause");
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement