Questions tagged as 'lista-encadeada'

2
answers

How do I go through a list chained from the last position?

I have a question about the list chained in C. The exercise is a function that receives as a parameter the initial node of the linked list and the position x (counting backwards). With this, I have to go through and find the position, return the...
asked by 18.04.2018 / 15:38
1
answer

How to compare two lists chained in C?

I'm having trouble with this issue: -I have to compare two linked lists and return 1 if they are equal or 0 if they are not. The function is like this and I can not progress: struct Node { int data; struct Node *next; } int...
asked by 11.04.2018 / 01:57
1
answer

List chained in C - Reversing the nodes recursively

I'm following Paulo Feofiloff's Algorithm Projects notes, and I'm with difficulties in resolving a question from the Chained Lists chapter, transcribed below:    Exercises 5       Write a function that reverses the order of cells in a l...
asked by 09.01.2018 / 01:11
1
answer

How do I remove a specific item from a double-chained list?

Given the 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; this.proximo = proximo; thi...
asked by 06.12.2017 / 17:45
1
answer

Exchange pointers list chained - python

I created a function to change the pointers of a linked list, the idea is very simple, I change them and update the next element so it does not lose the reference, but the function is losing the reference, eg, I tried a list l = 1, 2, 3, 4, 5, 6...
asked by 15.10.2017 / 18:46
1
answer

Change signature and parameters of some functions

I'm creating a program that inverts the non-vowel sequences of a word represented by a list that is simply chained, without head, and without sentinel. That is, each node in the list has a letter field. My work is to invert the non-vowel sequenc...
asked by 13.09.2017 / 01:36
1
answer

Error loading file for threaded list

This code loads elements of a .txt file, but apparently it can load the information from the file, but it gives some error in inserting the list, but I can not identify it. Here is the code and file information: #include<stdio.h> #includ...
asked by 18.03.2017 / 06:11
1
answer

Problem to create a linked list in C

Hello, I'm trying to create a linked list automatically, that is, it will be created inside a for . But for some reason I get the error segmentation fault, follow the code: no *lista, *cabeca; int n, r1, *r2; int i,j; cabeca = mall...
asked by 02.09.2016 / 20:47
0
answers

How do I insert a number in an arbitrary position, in a position I want?

Hello, how are you? I have this code and I need to know how I can enter a value in an arbitrary position, tried some ways, but I could not. Here is the code: #ifndef LIST_H #define LIST_H template<typename T> class List { public: List()...
asked by 25.11.2018 / 20:59
1
answer

Threaded Dynamic List Creation

I am studying data structure through the site: Uncomplicated C Language - Data Structure and in class 12 (3:52 min) the teacher develops the function that creates the list: // Implementação das funções lista* criarLista(){ lista* lde = (...
asked by 19.11.2018 / 17:11