Skip to main content
3 votes
1 answer
101 views

I am working on a handy reference sheet for my DnD Games, that includes 10 pre-planned encounters of varying difficulty that I want to reference on an Initiative Sheet by referencing the Encounter ...
Jonathan Rogers's user avatar
3 votes
2 answers
117 views

I'm working on this piece of code as part of my coursework, ideally any advice I get for this would be educational in some way; I don't want an exact answer, just need someone who knows more than I do ...
Eve's user avatar
  • 33
Best practices
1 vote
7 replies
170 views

So I'm making a linked list for one of my school assignments in C. I found this website that has some helpful code snippets, and I noticed that they use malloc() to allocate more memory every time ...
Klumpy7's user avatar
  • 123
-3 votes
1 answer
132 views

I am trying to create Linkedlist, where array is passed, and linkedlist is returned. However, there seems something wrong, and the linkedlist returned is circular. /** * Shared pointer, pass vector ...
Susobhan Das's user avatar
  • 1,310
0 votes
1 answer
169 views

I have been trying to create a method that can reverse a linked list. However, it only show the head of the original list without the rest of the parts showing up. I have tried making another, similar ...
Luna's user avatar
  • 1
1 vote
1 answer
53 views

I am learning about queue data structure in python. I learnt the implementation of a queue using list in python and the issue of memory wastage when we dequeue a few elements from the front. We use a ...
dataminer's user avatar
3 votes
2 answers
135 views

I’m trying to design a generic linked list in C where each node can store arbitrary data. Right now I have the following definitions: typedef struct { int clientID; char name[256]; } Client; ...
F. Zer's user avatar
  • 1,311
-1 votes
3 answers
273 views

I was trying to solve this LeetCode Problem, and have been failing at it. The problem You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the ...
Rajesh Dixit's user avatar
-6 votes
2 answers
168 views

I have simple question on C++ linked list. Say I am given a list, I just want to print for each node the value. I found this simple code on the net while (head!= NULL) { cout << head->...
chiva's user avatar
  • 631
-3 votes
2 answers
104 views

I want to create a circular linked list in a vector of struct instances. The vector is used because the count of the list elements is identified during execution of the process. I have a problem while ...
Vladislav Butko's user avatar
1 vote
1 answer
96 views

In this code: // Stack using LinkedList // #include <stdio.h> #include <stdlib.h> struct Node { int data; struct Node* next; }; struct Node* top = NULL; short isEmpty(void) { ...
Rohan Bari's user avatar
  • 7,739
0 votes
1 answer
165 views

I know that it's a never-ending question that comes back every now and then, but I'm really confused about these two. This is what I understand about them. In theory: LinkedList is faster at adding ...
sebkaminski16's user avatar
3 votes
3 answers
360 views

How does cache locality impact the performance of ArrayList compared to LinkedList in Java? I've often heard that ArrayList has an advantage in terms of cache locality, but I don't fully understand ...
Marat Tim's user avatar
1 vote
1 answer
156 views

I have implemented a linked list library in C. It has all the basic functions to quickly implement a linked list. I stored all that in a header file and an implementation file. Now I want my linked ...
Peter Kirsch's user avatar
0 votes
0 answers
111 views

I'm writing a Merge Sort to sort a linked list with inline RISCV asm, everything work fine until I start writing the part of lists merging. Here is my function: typedef struct Node { int data; ...
澪人桐's user avatar

15 30 50 per page
1
2 3 4 5
1329