ClaudeRhay 0 Newbie Poster

Say I have this definition:

#define SIZE 2000

typedef enum { TRUE, FALSE }Boolean;

typedef struct{
    char jobTitle[30];
    char jobDesc[255];
    char jobLoc[255];
    float salaryMin;
    float salaryMax;
    Boolean isAvailable;
}jobInfo;

typedef struct cursorNode{
    jobInfo jobRec;
    int next;
}HeapSpace[SIZE];

typedef struct hnode{
    HeapSpace heap;
    int Avail;
}*VHeap;

typedef int List;

typedef struct{
    List availJob;
    List notAvailJob
}dualList;

Let's say my function data type would be this:

dualList ConvertOld2NewList(VHeap *VH, List *L)
{




    return L; /*not sure about this since I will be converting this single list to a dual list*/
}

I was asked to write the code of function ConvertOld2NewList. Given a single list of job information, the function
will convert the given list which separates the available jobs from the non-available jobs and return
the newly created dual list to the calling function. In addition, each of the list in the dual list
is SORTED in ascending order according to the job title.

I was trying to figure out HOW EXACTLY would I be able to convert a given list into a dual list?

I'm considering statements like this:

if (VH->heap[?].jobRec.isAvailable == TRUE){

    /*place it in dualList.availJob ..... but HOW EXACTLY?*/

} else {

    /*dualList.notAvailJob*/
}

How would I traverse? Say I have an int/List pointer that is used for traversing, what statement would traverse it?

I have less knowledge about cursor-based implementation on linked list / array.
I was hoping that people here would be able to help me on this problem.
I'm practicing as well on my own too.

I hope you'll be able to help me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.