Most voted "chain-list" questions
A chained list is a representation of a sequence of objects in computer memory. Each element of the sequence is stored in a list cell: the first element in the first cell, the second in the second and so on.
Learn more…190 questions
Sort by count of
-
1
votes1
answer375
viewsError in Python function ("is not defined")
This was the simplest code I found in a demonstration of a chained list in python, I just couldn’t understand why it’s not working class NodoLista: #Esta classe representa um nodo de uma lista…
-
1
votes1
answer137
viewsIncrement pointer inside C-linked list
Good people, theoretically when we create a pointer and make it point to an array, int a[10] = {0,1,2,3,4,5,6,7,8,9}; int *p = a; then to increment the pointer to the next element we do something…
-
1
votes0
answers109
viewsTAD Alphabetical Order Method List
This is the first topic I’m posting, I’d like you to help me with this problem. The problem is based on ordering data entered in a Dynamic List (C#) according to name (Alphabetical order). As it is…
-
1
votes1
answer1406
viewsCompare two chained lists and return whether they are equal or different
I’ve been trying to compare two lists simply chained and return if they are equal or different but I’m not able to match the compare function, it only compares the last value inserted whether it is…
-
1
votes1
answer210
viewsfunction to insert a no in a linked list in C
How to complete the missing code in lines with 1. 2. 3. 4.? The goal is to add a new node with a given name and age at the end of the list. NOTE: I know there are less confusing and more practical…
-
1
votes2
answers143
viewsClone a list in Java
I have a class that reads a csv file and puts the table data on a list. public class Gerenciador { public LinkedList<Acidentes> listAcidentes; public Gerenciador() { listAcidentes = new…
-
1
votes1
answer196
viewsHow to remove an object from a list chained by the value of the attribute in C++?
What is the best way to remove an element from a list by the value of its attribute, without knowing exactly its position? I realized that the method Erase remove by position, and tried to use along…
-
1
votes1
answer61
viewsProblems when deleting the first element from the chained list
Dear friends, for example, I am using a list simply chained, without head and I need to write a function to delete an X element in the list. I made the following code: #define Limite 21 typedef…
-
1
votes0
answers116
viewsString chained list within a struct
Hello. I’m doing a job where I need to store words in a list that must be inside a tree struct. I don’t know why the code stops inserting in the list shortly after moving to the next key/line. The…
-
0
votes0
answers593
viewsHow to make a chained list with Javascript that points to an element I want?
Example: I have an array of blocks, each block has a process object that has a state attribute, which can be free or busy. How do I make every free process, point to the next free process even…
-
0
votes1
answer58
viewsProblem for creating a list linked in C
Hello, I’m trying to create an automatically linked list, IE, it will be created within a for. But for some reason I keep getting the error Segmentation fault, follow the code: no *lista, *cabeca;…
-
0
votes1
answer216
viewsInsert with "for" into a chained list
I have a question, the teacher asked to insert elements in the chained list using the "for" but I’m having difficulty, the Class that creates the node is already working perfectly and the part that…
-
0
votes1
answer286
viewsWhat is the function of this code snippet? Data structure (List)
I need to understand what each command of this is capable of doing, as it is without comment. struct Node{ int num; struct Node *prox; }; typedef struct Node node; int tam; int vazia(node *LISTA) {…
-
0
votes2
answers211
viewsCreate chained list with realloc()
I need to implement a simply chained list that does not have a next indication, that is, it should function as an array, accessing nearby positions in memory. I’m using the realloc() command to try…
-
0
votes1
answer208
viewsCan anyone tell me why my console doesn’t show up as a result of anything?
Receive a value n and print the following table using the structure chaining for: 1 2 4 3 9 27 4 16 64 256 n n² n³ ... n^n I tried to: import java.util.Scanner; public class Questao4 { public void…
-
0
votes1
answer325
viewsUse Arraylist or Linkedlist
The interface List has several implementations, among them ArrayList and LinkedList. Usually I have been using only ArrayList, but would like to know in which scenarios it is recommended to use the…
-
0
votes1
answer43
viewsSimply Chained List Printing/Abstract Data Type - ADT
I’m having difficulty not implementing the void exibe_lst(Telem* lst) function, I can’t get the entered elements to be displayed due to a conversion I don’t know how to solve. Follow the TAD link.…
-
0
votes0
answers39
viewsI cannot assign a value to the last element of an array
struct Numero{ ishort num; Paragraph *next; }; ishort array[3]; array[0] = grid1; array[1] = grid2; array[2] = grid3; array[3] = grid4; ishort i = 0; Numero *n; Numero *t; Numero *h; //lista…
-
0
votes1
answer70
viewsWhy can’t I print content in Chained List
Good evening, I have a problem with a college job. I need to create a linked list that receives student records. I created a function to register, however, I can not print, externally, the contents…
-
0
votes1
answer111
viewsChained list - Multiple error defenition of main
Good evening, would you be kind enough to help me with my project? I’m trying to create a chained list, but when I try to compile an error appears as the image below: I do not know what is occurring…
-
0
votes1
answer49
viewsShow Values greater than an X value in a C list
Suppose I declare a chained list in C and that list contains 7 integers, and I declare a value X = 20. List values: 3,9,11,18,20,22,25 Knowing that my X is equal to 20 which command I would use to…
-
0
votes2
answers59
viewserror: expected Expression before struct
Why are you making a mistake? Why? Error = |21|error: expected Expression before 'Simple list'| #define MAX 25 typedef struct Rota Rota; typedef struct ListaRota ListaRota; typedef struct…
-
0
votes1
answer656
viewsWhat is the complexity of each of these functions?
Simple circular list implemented in C #include <stdio.h> #include <conio.h> #include <stdlib.h> typedef struct s_no{ float info; struct s_no* proximo; } no_t; no_t* cria (){ return…
-
0
votes1
answer463
viewsread from binary file to linked list c
Good people, I’m having a problem reading information from a binary file to enter it in memory on a linked list. PERGUNTAS val; lista_perguntas * aux = original->next; lista_perguntas * base =…
-
0
votes1
answer1077
viewsC Circular Double Chained List Descending Ordering
I need a little help here with Double Chained Circular List to solve a bigger problem. I need to do a function that already enters my elements in descending order. My code even works with entries…
-
0
votes1
answer198
viewsError loading file to chained list
This code carries elements from a file. txt, but apparently it can load the file information, but it gives some error in inserting the list, but I’m not able to identify. Follow the code and file…
-
0
votes1
answer169
viewsProgram stopping responding in C - chained list
I’m doing a college job in C and I’ve pretty much finished it. However, I got caught up in a bug that I can’t get out of. My show, when I cross the line aux1=aux1->next; simply stops working. It…
-
0
votes1
answer393
viewsDouble Chained List Removal Doubt (C/ Ordered Insertion)
In a C++ class the teacher had proposed an activity where I had to do a program in the format of a double-chained list with ordered insertion. However, I have a problem on the Removal part. By…
-
0
votes1
answer555
viewsError >> TESTE500K.c:(.text+0x8f): Undefined Reference to `INSERT' <<
Guys, I’m trying to create a list but it’s making these mistakes TESTE500K.c:(.text+0x8f): Undefined Reference to `INSERT' TESTE500K.c:(.text+0xa5): Undefined Reference to `IMPRIME' [Error] Ld…
-
0
votes0
answers1473
viewsRemove even elements from a simply chained list
I am doing a function to remove ALL even elements from a simply chained list, but when I run the system, only one even element is removed each time I call the function. Ex: Elements={2, 4, 5, 3}, if…
-
0
votes0
answers72
views"Member access Within misaligned address" with a chained list
I’m solving a problem with leetcode (add two numbers that are inverted, each digit in a node of a chained list and return a chained list as a response). When giving Submit in the reply I get the…
-
0
votes1
answer76
viewsMethod malfunction Remove at position defined in Dynamic List
The following method performs a removal of an element at a pre-defined position in the test class but appears not to be working even if there are no syntax errors and errors in the teacher’s test.…
-
0
votes1
answer1589
viewsDouble chained list printing in reverse order
Good morning, this is my first post here at Stack Overflow. I was trying to get a double-chained list printed in reverse order. However, after going through this list in reverse, it produced the…
-
0
votes1
answer406
viewsProblem removing the first node from the double-chained list
Good night, I am trying to solve a question that asked to remove students whose CR is less than 5. My biggest problem is to remove the first node (first student) from a doubly chained list when…
-
0
votes1
answer62
viewsChange signature and parameters of some functions
I’m creating a program that reverses the non-vowel sequences of a word represented by a list simply chained, headless and without a sentinel. That is, each node in the list has a letter field. My…
-
0
votes1
answer43
viewsChained list returning empty outside function
I’m trying to read data from a file .obj and insert into a chained list, I have a function to read and within it I call the insert function. When I call the function of printing the list inside the…
-
0
votes1
answer82
viewsChained list prints beyond what is inserted
I have that function verticeobj* loadverticeObj(char *fname,verticeobj *vo){ FILE *fp; int read; float x, y, z; char ch; fp=fopen(fname,"r"); if (!fp) { printf("can't open file %s\n", fname);…
-
0
votes1
answer849
viewsSwitch chained list pointers - python
I created a function to change the pointers of a chained list, the idea is very simple, change them and update the next element so that it does not lose the reference, only that the function is…
-
0
votes1
answer1103
viewsHow to remove a specific item from a double-chained list?
Given class No, being: public class No<T> { T elemento; No<T> proximo; No<T> anterior; public No(T elemento, No<T> anterior, No<T> proximo) { this.elemento = elemento;…
-
0
votes0
answers36
viewsProblem in removing nodes on a list
Good night, I’m doing a show that’s sort of a "Candy Crush" on SDL. And I needed your help to help me remove the balls from the game, which in this case are the nodes on the list. The program is…
-
0
votes1
answer1153
viewsElement removal at the beginning of C chained list
In this C program, I’m trying to create a function that removes the first element of a chained dynamic list... #include <stdio.h> #include <stdlib.h> struct no { int dado; struct no…
-
0
votes1
answer1487
viewsChained list in C - Reversing nodes recursively
I’m following the notes of Algorithm Projects by Professor Paulo Feofiloff, and I’m having a hard time solving a question from the Chained Lists, transcript to follow: Exercises 5 Write a function…
-
0
votes0
answers76
viewsImplement interface with linked lists
Good evening, everyone, I could use a hand here. I’m starting to learn the implementation of linked lists in java, but I can’t understand or find a solution to this. I have this interface: public…
-
0
votes1
answer82
viewsHow to omit space to insert only numbers in different lists
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct NBIG{ int numero; struct NBIG *nseg; struct NBIG *nant; }Nbig; int main(int argc,char *argv[]) { char…
-
0
votes2
answers1519
viewsHow to compare two chained lists in C?
Guys, I have a problem with this issue: -I have to compare two chained lists and return 1 if they are equal or 0 if they are not. The function is like this and I can’t progress: struct Node { int…
-
0
votes2
answers1770
viewsHow to scroll through a chained list from the last position?
I have a question about a chained list in C. The exercise is a function that takes as parameter the initial node of the chained list and the position x (counting backwards). With this, I have to go…
-
0
votes1
answer656
viewsConvert recursive to iterative function
I have a chained list merge function working. However, recursion is being used and I would like to change the code and iterate. But I was unsuccessful. Follows the code: struct Node { int data;…
-
0
votes1
answer76
viewsNull list error
Guys I’m having a problem, my code is running right option 3 only the first time if return to the menu and try again it appears nulla. O case 3 is to list names in alphabetical and reverse…
-
0
votes0
answers48
viewsError in C list of structures
I’m working on a list of structures code, where I have a structure called Cad that contains the registration fields, name and salary. And a list containing a field of type struct Cad that stores the…
-
0
votes1
answer746
viewsJava: Dual-chained list (deck) implementation with callback, Generics, Exception and lambda
I’m doing the implementation in java, however I’m having some problems with how to integrate Generics and lambda in the deck: Deque.java: import java.util.ArrayList; public class Deque { private…