Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Filter by
Sorted by
Tagged with
1 vote
3 answers
113 views

I was watching a youtube video on doubly linked lists in C. One of the functions made for the doubly linked list was an "insert_after_node" function, which as the name suggests inserts a new ...
Samo's user avatar
  • 11
1 vote
1 answer
63 views

When inserting the first 8 pairs of keys and values it works perfectly fine and the order is maintained, the problem comes after the resizing. If I insert the pairs (4,4),(5,5),(6,6),(7,7),(1,1),(2,2),...
GoldenPlus 89's user avatar
-2 votes
1 answer
56 views

I am trying to print the contents of a Doubly Linked list using the str method by converting the content into string. The problem I face is that it returns the memory location of the values, not the ...
Rigo Estrada's user avatar
-1 votes
1 answer
56 views

I have been doing DSA lately on python, this time tried bubble-sort algorithm on a doubly linked list. Unfortunately, the method is not giving proper result. Please correct me, tell me where I am ...
Abhrajit Saha's user avatar
1 vote
2 answers
99 views

Now I have created a loop to make 25 nodes for the doubly linked list. By Initializing head pointer as NULL in the main function, now the forward_traversing and show_first functions do work as ...
Moonwalker's user avatar
1 vote
1 answer
149 views

I made a Doubly Linked List, but instead of manually assigning the values (10, 20, 30) I want to make a for loop and put the data that way to make it efficient. I did it in Singly Linked List but the ...
Moonwalker's user avatar
0 votes
1 answer
111 views

I have this homework where I need to create a doubly circular linked list for a Music Player UI. I wrote the addFirst method and it works fine but when I create the addLast method I seem to not be ...
Nilüfer Sevde Özdemir's user avatar
0 votes
2 answers
136 views

I have a Data Structure problem regarding a doubly-linked circular list in C++. I've implemented a doubly linked circular list using class templates. When testing the circular nature of the list by ...
benhpark's user avatar
2 votes
3 answers
167 views

I have written a code on deleting a node by comparing its data from the data given. If equal, it deletes the node. My problem is that my code will delete every node in the list except the last node, I ...
user avatar
1 vote
3 answers
149 views

I made a doubly link list and ran it a couple times with functions to add nodes at end, output the length of the list and to print all the elements. It was working fine. Then I made a function to add ...
Abhinav Sharma's user avatar
0 votes
0 answers
102 views

The statements for my questions are: Write a program to determine whether a linked list is a palindrome or not. **Input Format: ** The first line contains integers separated by spaces representing the ...
Mridul Hemrajani's user avatar
3 votes
1 answer
153 views

I am solving leetcode LRU design problem - Leetcode LRU: Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int ...
Karthik G Sarode's user avatar
0 votes
1 answer
195 views

I wrote this code where you can add or remove numbers from a list, and then display the list. The problem is: it displays the numbers in reverse order, except for the first added number. program ...
Adriana's user avatar
0 votes
1 answer
67 views

I can't figure out why my print functions won't work. It seems that when i create objects of the list they do not point at each other as expected. Somehow when those objects are created they will ...
Warerre's user avatar
0 votes
1 answer
92 views

I have the following implementation for a Doubly Linked List -> struct Node<T> { value: T, next: Option<Rc<RefCell<Node<T>>>>, prev: Option<Weak<...
KillerFC's user avatar
0 votes
1 answer
64 views

#include <stdio.h> #include <stdlib.h> #include <string.h> struct data{ char help[5]; struct data *next; struct data *prev; }*head = NULL, *tail = NULL, *curr = NULL, *...
Fernando Gunawan's user avatar
0 votes
1 answer
276 views

I created a simple Doubly Linked List, with an append method and a str() that is supposed to return the elements present in the list. Here is the code; class Node: def __init__(self,val): ...
NK Rao's user avatar
  • 53
0 votes
0 answers
41 views

So there is code that is supposed to poll a GPIO read pin at a certain rate and put the SET/RESET result to a doubly linked list of 16 elements, deleting the first added (firstIn) element. formArray() ...
2222's user avatar
  • 1
-3 votes
1 answer
94 views

I am a freshman in IT and we did a quiz about linked lists and one of the questions was: Linked List. Show the resulting list (redraw) after the following statements are executed. So we have a doubly ...
Yoo's user avatar
  • 1
2 votes
2 answers
290 views

Im trying to shuffle a doubly linked list without changing it's pointers. So far my idea to do this is to have a position integer value that gets assigned randomly to each struct in the doubly linked ...
sangregoriokimpo's user avatar
-1 votes
1 answer
81 views

I am trying to import a book by prompting the user to provide its details in the command line one after another. For that I am using an overloaded input operator but when trying it out it results in a ...
Alexander Hunger's user avatar
0 votes
0 answers
21 views

I'm working with structures in C where I've defined a doubly linked list and a function to add elements to the left of the list (list_add_left). The problem I'm facing is that I only have the name of ...
Sophie's user avatar
  • 1
0 votes
1 answer
148 views

I made a program to insert a element in doubly linked list given below(ignore create and display functions Which was working perfectly right till it found the index to be inserted is 5 ,where it fails ...
Harshal Malani's user avatar
0 votes
1 answer
105 views

use std::{mem, ptr}; pub struct DList<T> { dummy: DNode<T>, } struct DNode<T> { data: T, next: *mut DNode<T>, prev: *mut DNode<T>, } impl<T> ...
Noah's user avatar
  • 85
0 votes
1 answer
128 views

This code aims to create a hospital data management application using doubly linked circular lists. It can be divided into two main parts: Classes: The Patient, Medicine, Doctor, and Disease classes ...
Meral Hamarat's user avatar
1 vote
1 answer
111 views

I am learning linked lists and was doing a question which asks you to reverse a doubly linked list. My code works perfectly fine but I don't understand how. You can ignore whole thing except the ...
Aditya singh's user avatar
0 votes
1 answer
332 views

I'm constructing a "scenegraph", which is a hierarchical data structure of Shape nodes (e.g. sphere, cube, mesh, etc. not shown in example code). A Shape can own zero or more child Shape ...
davidA's user avatar
  • 13.9k
0 votes
2 answers
88 views

I was going through this solution for implementing a doubly linked list when I came across this doubt public class Solution { public static Node constructDLL(int []arr) { Node head = new ...
mysterymartian's user avatar
0 votes
1 answer
40 views

I am making a project right now to practice double linked lists and I have been working on a method in my double linked lists class which switches node locations. It works fine when trying to switch ...
TylerDr16's user avatar
0 votes
0 answers
54 views

The code below works to sort a singly linked list using class functions.It takes user input into an array, turns that array into a linked list, and then sorts it. I am uncertain on what changes I ...
Ethan Wallis's user avatar
1 vote
2 answers
70 views

I am learning linked list and I'm creating doubly linked list. My print backward is not working as intended. For better Information I will highlight the print backward function. Print Backward class ...
user avatar
1 vote
1 answer
86 views

I've written the function for removing duplicate elements in a doubly linked circular list. However when traversing the list after removing, I am not getting the desired output. I have used typedef to ...
Great412's user avatar
2 votes
1 answer
282 views

So, as a hundreds of thousands of people before me, I am implementing a doubly linked list in С++. Here's a Node and List struct: struct Node { std::shared_ptr<Node> prev, next; int data;...
lian's user avatar
  • 543
0 votes
1 answer
69 views

I am trying to implement a function to delete a node from the end of a circular doubly linked list in C. However, when I run the code, it goes into an infinite loop and produces a continuous stream of ...
Tolga's user avatar
  • 3
1 vote
0 answers
98 views

I created two dictionaries, one using doubly linked lists and another using binary search trees, both with some basic functions. I want to estimate the Big O notation for both dictionaries and compare ...
Stats...'s user avatar
2 votes
1 answer
109 views

I was solving this LeetCode question - Flatten a Multilevel Doubly Linked List: You are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an ...
Vaishnavi Killekar's user avatar
0 votes
0 answers
58 views

I have an assignment in which I have to implement a doubly linked list ADT. I do not have issues with that, I created something like this: class DoublyLinkedList{ struct Node{ int value; ...
Thalia's user avatar
  • 27
0 votes
1 answer
51 views

I tried to make a doubly linked list class using generics, and make lists with three different data types (int, double, string). As far as I know, T works just as a parameter for generics, and will ...
tof's user avatar
  • 3
2 votes
1 answer
87 views

We have a circular doubly linked list with several elements. Every element has a link to the next element, a link to the previous element and a boolean value (true or false). Four operations are ...
KasimKas's user avatar
0 votes
1 answer
29 views

I wrote this code to delete a node from a linked list: void deleteNode(struct node **head, int element) { if (*head == NULL) return; struct node *temp = *head; while (temp != NULL ...
Dhana Prakaash's user avatar
-2 votes
1 answer
75 views

I'm creating a toString() function that should return a String created by concatenating each Nodes toString(). A single space: ‘ ’ should be inserted between each Nodes toString(). No trailing space ...
softloftmaria's user avatar
0 votes
1 answer
69 views

I`m making an application that opens an image in a WindowsForm PictureBox and by clicking left arrow or right arrow, it will change to previous or next image in the same folder. In order to change ...
Carlos Siestrup's user avatar
0 votes
1 answer
138 views

I want to make bubble sorting algorithm with doubly linked list in python. Node has prev key and next key. The list connected end node and start node(head) This is My Node defenition class Node: ...
roha2i's user avatar
  • 13
-1 votes
1 answer
62 views

I'm trying to improve my double linked list API. int ll_create(linked_list_p list, void (*print_data)(uint8_t)) { if (list == NULL) { list = calloc(1, sizeof(linked_list_p)); ...
Toideki's user avatar
-3 votes
2 answers
90 views

#include <stdio.h> #include <stdlib.h> struct chambre { int num; struct chambre *prd; struct chambre *svt; }; typedef struct chambre chambre; struct ascenseur { char c; struct ...
Youcef Abdelaoui's user avatar
-1 votes
1 answer
77 views

I have created a python class for doubly linked list. It looks like this: from tabulate import tabulate class Node: def __init__(self, value): self.data = value self.next = None # ...
Debaditya Nath's user avatar
0 votes
1 answer
57 views

Okay, so I'm trying to swap two elements in a doubly linked list without altering the data and without using collections. Here's what I have so far; package q2b; public class DoublyLinkedList { ...
Dash Harber's user avatar
1 vote
1 answer
50 views

All my other functions of my doubly linked list which consist of Account class and Node class are all working except this last function. The function bool deleteAcc(string name) will take as it’s ...
Jac Investigator's user avatar
-1 votes
1 answer
158 views

I'm hoping to get a result like in Build a spreadsheet from a list of tuples of (row, column, value) using 2D array. no numpy, but instead of 2d lists it is a linked list of linked lists. Currently I ...
newToCode's user avatar
1 vote
1 answer
75 views

I'm practicing linked data structures in Python. One problem I'm working on is a method to swap two nodes within a doubly linked list without just moving data. So no node1._data=node2._data or ...
ATR2400's user avatar
  • 41

1
2 3 4 5
37