Search:

Type: Posts; User: AlaaAssaf

Search: Search took 0.07 seconds.

  1. Re: Building a linked list whose nodes data is the sum of nodes of other list

    i took the second option ,, and IT WORKED ,, :D
    Thank u very much for ur time
  2. Re: Building a linked list whose nodes data is the sum of nodes of other list

    Oops then nw I have two problems
    1 the printing issue (it printed when I called the method within the sum2List()method,, but it is not printing when i call it in the main method )
    2 reversing the...
  3. Re: Building a linked list whose nodes data is the sum of nodes of other list

    OKAAAY I should have called the printList method in the sum2List itself,,
    Thank u very much ,,
    u helped me point out my misconception
  4. Re: Building a linked list whose nodes data is the sum of nodes of other list

    run:
    This is the original value of sum 0
    This is the sum 7 This is the sum 80 This is the sum 8
    List1's elements are
    3->2->1->
    List2's elements are
    4->78 ->7->
    List3's elements are
    BUILD...
  5. Re: Building a linked list whose nodes data is the sum of nodes of other list

    package q3;


    public class ListNode {
    //variables the data and link to next node
    int data;
    ListNode next;

    //constructor
    ListNode(int d, ListNode n){
  6. Re: Building a linked list whose nodes data is the sum of nodes of other list

    package q3;


    public class ListNode {
    //variables the data and link to next node
    int data;
    ListNode next;

    //constructor
    ListNode(int d, ListNode n){
  7. Re: Building a linked list whose nodes data is the sum of nodes of other list

    package q3;
    //class for the nodes
    public class ListNode {
    //variables the data and link to next node
    int data;
    ListNode next;
    ListNode(int d, ListNode n){
    data = d;
    next = n;
  8. Re: Building a linked list whose nodes data is the sum of nodes of other list

    I already did a complete program there are no errors ,, it is only that the first is pointing to null that is why it is not entering the loop



    public class listNode {
    int ...
  9. Building a linked list whose nodes data is the sum of nodes of other list

    public void add(int d){
    listNode l = new listNode (d, null);
    l.next = first;
    first= l;

    }

    public list Sum2List (list l1, list l2){
    //variables
    int sum;
Results 1 to 9 of 9