User Profile

Collapse

Profile Sidebar

Collapse
vekka
vekka
Last Activity: Feb 14 '08, 01:35 PM
Joined: Feb 12 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • vekka
    started a topic Merge algorithm
    in C

    Merge algorithm

    Hi!
    Could someone please help me to understand the use of merge algorithm(conce ptually) with linked lists. What I want to do in the linked list function is:
    the function gets two inputs, i.e the pointers to the two smaller lists, then the function should able to merge these two together, and then return the head-pointer to this merged list. What happens in my case, is that I "lose" data when running it . My result is like...
    See more | Go to post

  • vekka
    replied to need help with a union function in a linked list
    in C
    Sorry, I forgot to show the struct itself:
    [CODE=c]typedef struct set_node set_node_t;
    struct set_node {
    set_node_t *next;
    void *elem;

    };
    struct set {
    int size;
    set_node_t *head;
    cmpfunc_t cmpfunc;
    };[/CODE]
    See more | Go to post
    Last edited by Ganon11; Feb 12 '08, 03:52 PM. Reason: Please use the [CODE] tags provided.

    Leave a comment:


  • vekka
    started a topic need help with a union function in a linked list
    in C

    need help with a union function in a linked list

    Hi!
    Programming language: C
    I wondered if any of you are able to see what is wrong with my code. What I want to do is to find the union of a set of numbers. I use a singly linked list. and my union function is based on a simple merge algorithm.
    There are four different sets: even numbers, odd numbers, prime numbers and non prime numbers.

    When I run my program now, it prints out:
    Even or Odd numbers: 0 1...
    See more | Go to post
    Last edited by Ganon11; Feb 12 '08, 02:36 PM. Reason: Please use the [CODE] tags provided.
No activity results to display
Show More
Working...