Advertisement
porteno

Untitled

Nov 21st, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2. public class Hw{
  3.  
  4. public static void main(String[] args) {
  5. Node<Integer> nd1 = new Node<Integer>(51);
  6. Node<Integer> nd2 = new Node<Integer>(50, nd1);
  7. Node<Integer> nd3 = new Node<Integer>(20, nd2);
  8. Node<Integer> nd4 = new Node<Integer>(15, nd3);
  9. Node<Integer> nd5 = new Node<Integer>(12, nd4);
  10.  
  11.  
  12. Node<Integer> node1 = new Node<Integer>(46);
  13. Node<Integer> node2 = new Node<Integer>(44, node1);
  14. Node<Integer> node3 = new Node<Integer>(42, node2);
  15. Node<Integer> nd = append_By_Value(nd5, node3);
  16.  
  17.  
  18. }
  19. //given two chains u need to connect them by the correct numeric order
  20. public static Node<Integer> append_By_Value(Node<Integer> ndList1, Node<Integer> ndList2){
  21. //addcode here
  22.  
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement