2020欧洲杯时间表

Questions tagged [singly-linked-list]

2020欧洲杯时间表 A linked list in which each node only points to the next node in the list, as opposed to a doubly-linked list in which each node points to both the next and the previous nodes. This tag should be used with additional tags indicating the programming language being used ([c], [c++], [java], etc.) and any libraries or plug-ins being used such as [c++-standard-library]. The post itself should contain source code for the issue.

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Maximum Sort of a Simple One-way List

I'm trying to do the Maximum Sort of a Simple One-way List. However my program has some bugs in it, which I can't figure out what it is. It behaves strange because sometimes it works well to a point ...
0
votes
0answers
13 views

C - alphabetically sort list [closed]

Any of you have idea how can I alphabetically sort words read from file and make singly-linked list of them? I mostly need help with sorting algorithm. Mostly I need the code, at least example.
-1
votes
2answers
36 views

delete without a head pointer

Question: You are given a certain node somewhere in the middle of the linked list and you need to delete that node. You are not given the head node to the linked list. Condition: the given node has ...
-1
votes
2answers
49 views

How can I delete an element of a linked list in python with only access to the element to delete? [closed]

Hi I am working on a leetcode problem: (Link for those with accounts: http://leetcode.com/explore/challenge/card/june-leetcoding-challenge/539/week-1-june-1st-june-7th/3348/) Write a function to ...
0
votes
0answers
26 views

C - add element to sorted-linked-list (alphabetical sorting)

I have to do some kind of work here. My task is to write words from file to a struct in alphabetical order. I thought "hmmmm.. that's easy", but not - it isn't. Or just I f*cked it up :( Can you guys ...
0
votes
1answer
50 views

C - how to get rid of memory leaks?

How can I get rid of memory leaks from for example this function: void AddData(Data **head, char *sentence, int number) { Words *words = NULL; char delimiters[] = " \n\0"; char *token = ...
0
votes
1answer
16 views

Compare elements from 2 singly-linked lists and program (usually) crash

I have the project to do. Assumptions are like that: From file with words i need to read only alphabetic words (into list called Words - code below) - I did it by use isalpha() function from lib. ...
0
votes
0answers
32 views

Sorting and dynamically allocation singly-linked list in C

My code works but only for small amount of data, like this: * c d b a A C B D * input is -> ** a A b B c C d D ** I need it for huge amount of data, like few MB of txt file. My program has to read ...
0
votes
3answers
41 views

Cannot access memory error for character array in struct - C

I am attempting to create a queue using a linked list in C. I am using two structs to represent the queue and each node which are as follows. #define DATA_MAX 100 struct QueueNode_ch { struct ...
0
votes
2answers
23 views

Why does the singly linked list not insert correctly

I have a single linked list that I can insert up to 4 char values into. My goal is to get the insert to work which I do have working but the problem is that if the head of the Linked List is a greater ...
0
votes
0answers
21 views

Linked list C program unexpected behaviour in conditional statement

I was executing below linked list program,but this code is behaving in an unexpected way ,when i compared head with NULL it dont executes if() block and reaches to else block , but inside if() ...
-1
votes
2answers
57 views

Insert a node at specific position in a linked list in C (only)

Can anyone help me where I'm going wrong please !!!, I'm a beginner to programming, I'm new to DSA, I'm not able to find my mistake, here is the code please go through it: This is the outline of my ...
-1
votes
2answers
83 views

Bubble Sort on singly linked list Worst Time Complexity?

I know that a singly linked list only points to the next value and cannot point to the previous value, so am I right to think that in a bubble sort the list would act the same as an array where it ...
-1
votes
2answers
34 views

How to add an organ to a specific location in a linked list in C

I have a linked list, and two given words. I need to find the index of the first word in the list and then add the second word immediately after the first word. In the C language How to do it? Thanks ...
1
vote
1answer
34 views

Singly Linked List creation problem without using a function

//linked_list_1 #include<stdio.h> #include<stdlib.h> struct list { int data; struct list *link; }; int main() { struct list *ll=NULL, *tp=NULL; int n=3, i; ll=(...

15 30 50 per page
1
2 3 4 5
114