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
-
14
votes2
answers3665
viewsWhat’s a chain list?
I’ve been reading some materials and I’ve seen a lot of talk about chained lists. I even saw the code example (in C) below that tried to "illustrate" what was a. struct Node { int info; struct Node…
-
11
votes2
answers3185
viewsBinary search in chained list
How can I perform a binary search on a simple chained list with head? Also if it is possible to do this, if there is some special method. In the EP I can not count beforehand the amount of elements…
-
7
votes3
answers1081
viewsSort chained list with O(n*log(n) method)
I need to sort a chained list (own implementation, without using Java API) with a sorting method that has O(n*log(n) complexity. Researching methods that satisfy the condition found the quicksort,…
-
7
votes2
answers330
viewsDynamic allocation and runtime of functions
When we use any of the dynamic allocation functions in C (malloc, calloc, realloc, etc.), within a function that is called by main, will the memory remain allocated at the end of the execution of…
-
6
votes1
answer1153
viewsWhat’s the head of the chain list?
I didn’t understand what head or (head) of the list means, and what is the advantage in using it?
-
5
votes1
answer452
viewsKnow the most repetitive code in a data structure (list)
I’m doing a project in Java of data structures and I have a list simply chained that gets the code, name, sex and course of each person. I only need to validate which code (whole type) repeats the…
-
5
votes3
answers1128
viewsEntity Framework - Update nested lists
I have the following schema in my Mysql BD: Models have a list of standard_images and each standard_images has a list of standard_regions. I must use Entity Framework 5.0.0. I have a model with 3…
-
5
votes1
answer90
viewsWhat’s wrong with my chained list?
I implemented a chained list but when I enter 2 items, I remove the last one and add it again, for some reason it says that the value is null. public class ListaDinamica<T> { private class…
-
5
votes1
answer259
viewsWhy not iterate a hashmap?
I was doing a project and one of my colleagues mentioned that iterate hashmaps is something to avoid and instead of using hashmap should wear Linked lists. However I think the versatility of the…
-
5
votes2
answers1449
viewsPutting and comparing dominoes in order in C, using list or not ( if you can without)
The program asks to check if you have equal dominoes ( if you have at least one possibility to merge data 12|21) and asks to show an order that reaps the basic rule of the Dorians ( 12|24|45|53 );…
-
5
votes3
answers300
viewsCode for reversing sequence of non-vowels ending with zero status
I’m implementing the function decodificar, which aims to call auxiliary functions to reverse all non-vowel sequences. For example, if the word is "cool monsters," it will go to "mortsnol segais".…
-
4
votes1
answer813
viewsHow to make a Chained List in Assembly?
I have a college job and I need to make a chained list at Assembly, would like to know how to do the loop to insert all items in the list and keep them connected. The list must contain the data of a…
-
4
votes2
answers4158
viewsHow to create a dynamic chained list within another dynamic list in C?
I’m having a really hard time creating a dynamically chained list inside another one using data structure. I can create a dynamic list, but I can’t create another one inside it. To illustrate what I…
-
4
votes1
answer2274
viewsChained list without head in c
I wonder how I create a function to remove at the top of the list headless. #include <stdio.h> #include <string.h> #include <stdlib.h> #define MAX_NOME 50 typedef struct pessoa{…
-
4
votes1
answer152
viewsTyping a pointer to struct
I was suggested to build a chained list using the following struct knotted: typedef struct node *link; struct node{ int item; link next; }; As I did not understand what the pointer operator means…
-
4
votes1
answer1154
viewsChained lists in C
I have two lists in C, where you should include several records in the list of customers, and then make sure that some customer can book a car that is stored in the list of cars. The part of…
-
4
votes1
answer149
viewsWrite list in binary file
The idea of this method is to write all the words of a list of nodes in a binary file. I have a linked list of nodes, where each node has two information, its information, and a reference to the…
-
4
votes2
answers137
viewsIs it possible that a class attribute is the class itself?
I’m starting to learn C++ Object oriented, and I have to make an algorithm using chained lists. In C, I used a structure that had as one of the attributes a pointer to the structure itself. I wonder…
-
4
votes1
answer1263
viewsConcatenation of two chained lists
The problem is: Write a program and make a function to concatenate two lists of integers into a third list that must be returned by the function, in C#. My doubt is only on how to concatenate the…
-
4
votes1
answer708
viewsWhat does Nodo mean?
I am studying stacks and queues, below I was given a code to analyze. The code first creates queue then queues the values. After this, it removes each of the values from the queue and warns whether…
-
3
votes1
answer585
viewsHow do I add a different object to a list whenever using the add?
I’m having trouble adding a different object to a list of objects whenever I use her add, I know what the problem is but I don’t know how to fix it, follow the code List class public class Lista {…
-
3
votes3
answers5915
viewsStruct and chained list
I created a person-like structure and I intend to use it in a chained list, but the following errors appear: 'No has no Member named 'data', 'No' has no Member named 'Prox' and unknow type name 'p'.…
-
3
votes1
answer5335
viewsJava remove an item within a chained list Simple
I am having difficulties in generating a code to remove an item from a certain position in a chained list, this is not an Arraylist, but a chained list, for this I am creating a method as below:…
-
3
votes1
answer4464
viewsRemove item from simply chained list
I’m having trouble removing an item by the value of a simply chained list. I’m doing so: class No{ public: int dado; No *next; No(int item, No *ptr= NULL){ dado=item; next=ptr; } }; class Lista{…
-
3
votes2
answers3318
viewsC - How can I read data from a file (Considering that I use structures for it)
Good night. I’m working on a project for the College in C where I have a data structure to work with the data common to "Offenders," or those who committed an infraction. typedef struct Infractores…
-
3
votes2
answers12386
viewsProblem to remove chained list element in C
My function is only removing the first element if I enter the name of that first element. I would like to know how I do for the function find the element and remove it. The insert function this…
-
3
votes2
answers1697
viewsRemove element from a chained list
I am implementing a chained list of type "with head". It follows struct referring to the list and its creation in main() struct lista{ int info; struct lista *prox; }; typedef struct lista Lista;…
-
3
votes1
answer60
viewsIn a chained list structure, why is a pointer to the node pointer used?
When reading my teacher’s slides I was left with a question regarding this structure: struct node { char item; struct node *next; }; typedef struct node Node; typedef node *Lista; It wasn’t clear to…
-
3
votes1
answer762
viewsChained list - sort by selection
I am playing a sorting algorithm by selection using chained list. I’m using two loops using a min cell, i and j, with respect to cell j, ok, but at the time of changing the min pointers and i is not…
-
3
votes2
answers461
viewsProblem removing element from a chained list
I’m implementing a chained list in Java. However, the removing function is causing me some problems, but specifically the removing part in the middle of the list. My list consists only of a field of…
-
3
votes1
answer139
viewsIs there a problem with pointers in this struct that works with chained lists?
Hello. I’m developing a game with C++ language and I think I’m making a mistake in using chained lists. I think I know that there are more interesting features than using chained lists in C++, but…
-
3
votes1
answer988
viewsSearch for List Element
I want to search an element of a list through a name (character vector). I get the name (espm) in the function and start to search. The problem is that the function always tells me that "There is no…
-
3
votes2
answers936
viewsChained list: how to modify data from a list without changing the others?
I have a for that generates a list of data lists lista[[...], [...]] Inside the "daughters" lists may or may not have other lists lista[['dado11', 'dado12', [link1]],['dado21', 'dado22', [link2]]…
-
3
votes1
answer469
viewsChained list, union of structures
I have some difficulty in uniting two structures in the same chained list, I have never worked with generic lists or even associated in one activity two structures, I have the following structures:…
-
3
votes1
answer214
viewsProblem removing at the beginning in a doubly chained list
Hello. When I try to use the "remove" function to remove the first element from the list, apparently nothing happens. But, soon after using the function removes and try to insert a new node in the…
-
3
votes1
answer1345
viewsDouble chained list - Java
I’m trying to create (I’m learning) a doubly chained list based on an exercise, in which the list will be a train with wagons. The exercise asks to create a class "wagon", where the variables "wagon…
-
3
votes1
answer1668
viewsInvert simply chained list
I did the implementation of a chained list and the method to list the elements, but I now wanted to print it upside down (For example: 1>2>3 = 3>2>1). Could someone help me?…
-
2
votes1
answer685
viewsLinkedlist Recursive Method
I’m having trouble implementing a recursive method for inserting an element at the end of a simply chained list. Below is the Iterative method: public void addLast(Node<E> novoNodo){…
-
2
votes0
answers103
viewsSort chained list in MVC standard project
In my project I am using my own chain list implementation, that is, I am not using the ready list of the Java API. In addition, my implementation is of a generic list, which has Object objects on…
-
2
votes1
answer921
viewsError while printing chained list
Hello, I have an error in the function that prints a chained list. I think the error is in the print function’s for, but I may also be saving the address of prox wrongly. Follows the code: /* *…
-
2
votes1
answer218
viewsError comparing two strings
I’m trying to compare two strings, when I enter a name in my chained list it cannot be entered if it already exists. I have used the function searchname to display a searched name and to delete, but…
-
2
votes1
answer631
viewsList of structs
I would like to know the advantage of using a list in this way. typedef struct Pessoas { char nome[20]; int idade; struct Pessoas *prox; }pessoas; typedef struct Funcionario { pessoas *pessoa;…
-
2
votes2
answers402
viewsOperation to release a circular list
I am in doubt in the implementation of the method of releasing the memory of a circular chained list: void liberarLista() { if(head == NULL) return; //retorna original(NULL); lista *aux, *temp =…
-
2
votes1
answer142
viewsData Structures - List Differences
Please would like to know the real difference between these structures below: typedef struct { int info; struct lista * prox struct lista * ant; } tipo_lista; and that: struct noCliente { int…
-
2
votes2
answers65
viewsSegmentation Fault when removing list occurrences
The following code aims to remove all occurrences of an integer in a list, (linked lists), returning at the end, the number of elements removed. Give me the error of Segmentation fault. I appreciate…
-
2
votes2
answers208
viewsProblem with threaded list pointer offset
I’ve had a problem with the shift of pointers in my code for a few days now. I try to make that if the point of my object on the screen is greater than a value, offset this object from memory, but…
-
2
votes2
answers10186
viewsHow to order a chained list in alphabetical order?
I have to make a program that creates a chained list containing structs with information from a participant(name, Cpf...). I have already inserted the function and I want to sort the chained list in…
-
2
votes1
answer153
viewsRemoval item in chained list C
Guys I’m having a very annoying little problem, I’m implementing a simple A* . When I move the already checked item to the closed list and move the item from the open list, it is giving undeclared…
-
2
votes1
answer192
viewsProblem with Dynamic Allocation - Segmentation Failure
I defined two structures to represent a straight line. I need to open a file that contains the values of a line by line, put the values in a chained list. This I was able to do.…
-
2
votes1
answer1505
viewsHow do I get this list double-chained and circulated?
#include <stdio.h> #include <stdlib.h> #include <string.h> struct Tipo_Lista{ char cod[50] ; struct Tipo_Lista *Prox; struct Tipo_Lista *Ant; }; struct Tipo_Lista *Primeiro; struct…