Thứ Ba, 9 tháng 6, 2015

Exercises linked list

10. int count() - count and return number of nodes in the list :



11. void dele(int i) - delete an i-th node on the list. Besure that such a node exists.  :


12. void sort() - sort the list by ascending order of info ;
13. void dele(Node p) - delete node p if it exists in the list :
18. int max() - find and return the maximum value in the list. :

19. int min() - find and return the minimum value in the list :
20. int sum() - return the sum of all values in the list :
21. int avg() - return the average of all values in the list ;
14. int [] toArray() - create and return array containing info of all nodes in the list :
16. void addBefore(Node p, int x) - add a node with value x  before the node p :

Không có nhận xét nào:

Đăng nhận xét