C linked list question, urgent answer

Updated on technology 2024-05-28
5 answers
  1. Anonymous users2024-02-11

    #include

    #include

    #define num 4

    #define n 3

    using namespace std;

    struct node

    string nam;

    float sco;

    struct node *link;

    I think it's a little more convenient to use string, but I don't know if it meets the requirements.

    int main()

    node *ptr[num],*pnode;

    for(int i=0;i>ptr[i]->nam;

    cin>>ptr[i]->sco;

    pnode=ptr[i];

    for(int j=1;jlink=new node;

    pnode=pnode->link;

    cin>>pnode->nam;

    cin>>pnode->sco;

    pnode->link=null;

    string name="shuxu";

    node *p;

    for(i=0;inam) coutelse p=p->link;

    return 0;

  2. Anonymous users2024-02-10

    This should be doubly linked.

    with two structures.

    The main chain is the student chain, and the slave chain is the course chain.

  3. Anonymous users2024-02-09

    You made it up in C++, and people want it.

    But it's pretty much the same, just change some inputs, outputs and header files.

  4. Anonymous users2024-02-08

    Summary. The biggest difference between the cursor implementation and the pointer implementation of a one-way linked list is that the cursor implementation cannot be connected to the next node by a pointer, and it can only index the next node by means of array subscripting, so the cursor implementation needs to manually manage the array memory usage compared with the pointer implementation, this paper directly adopts the idea in "Data Structure and Algorithm Analysis: C Language Description", but this paper uses a dummy node, the 0th node of the agreed array is used to simulate the management of memory, and the 1st node is used as a dumb node. The specific definitions and implementations are shown in the following sections.

    C uses a linked list structure (one-way linked list) to write a function func that has an int parameter. The function function is to implement the keyboard to input one (only 3 parameters can be entered) int parameter into the tail of the linked list, and output the parameters in the linked list. Such as:

    Linked list list, enter separately, 10, 20, 30 each output :list:10list:

    10->20list:10->20->30...list:

    10->20->30->.How to solve the above problem with the input parameters.

    The biggest difference between the cursor implementation and the pointer implementation of a one-way linked list is that the cursor implementation cannot be connected to the next node by a pointer, and it can only index the next node by means of array subscripting, so the cursor implementation needs to manually manage the array memory usage compared with the pointer implementation, this paper directly adopts the idea in "Data Structure and Algorithm Analysis: C Language Description", but this paper uses a dummy node, the 0th node of the agreed array is used to simulate the management of memory, and the 1st node is used as a dumb node. The specific definitions and implementations are shown in the following sections.

    I would like to know the ** that implements the feature.

    Teacher, can you make up the above question in C? I'd like to know the C language that implements this feature**.

    Wait a minute, there's something wrong with the system.

    Good. Haven't you got it yet?

    It's been 5 hours since the teacher

  5. Anonymous users2024-02-07

    A linked list is a non-contiguous and non-sequential storage structure on a physical storage unit, and the logical order of data elements is achieved through the order of pointer links in the linked list.

    A linked list consists of a series of nodes (each element in the linked list is called a node) that can be dynamically generated at runtime.

    Each node consists of two parts:

    1. The data domain where the data element is stored;

    In C, the construction of a linked list is achieved through a struct, a struct variable that forms a node of a linked list.

    Within a struct, an element that needs to have at least one pointer of type as a struct itself exists as a pointer field to point to the next or previous (only for doubly linked lists) element nodes.

Related questions
3 answers2024-05-28

Heada and headb are both singly linked lists with leading nodes. In this algorithm, we delete the common elements from the ith element in the heada linked list, and then insert the single-linked list heada before the jth element of the headb. >>>More

2 answers2024-05-28

Let's take an analogy. Think of a linked list node as a person, and a linked list pointer as a human hand (the left hand is the forward pointer, and the right hand is the backward pointer). >>>More

6 answers2024-05-28

linklist reserve_fei(linklist l,int n)

What does n do. >>>More

4 answers2024-05-28

2. The identifier must start with the letter a z, a z or an underscore, select b >>>More

11 answers2024-05-28

Your logic is not wrong.

There's a slight mistake with your format: scanf("%d,%d,%d", y, m, d) should be replaced by : >>>More