Top "Singly-linked-list" questions

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.

How to reverse a singly linked list using only two pointers?

I wonder if there exists some logic to reverse a singly-linked list using only two pointers. The following is used …

c algorithm data-structures linked-list singly-linked-list
Interview Question: Merge two sorted singly linked lists without creating new nodes

This is a programming question asked during a written test for an interview. "You have two singly linked lists that …

algorithm singly-linked-list
Reverse Singly Linked List Java

Can someone tell me why my code dosent work? I want to reverse a single linked list in java: This …

java singly-linked-list
Java - Does returning a value break a loop?

I'm writing some code that basically follows the following format: public static boolean isIncluded(E element) { Node<E> …

java while-loop boolean return singly-linked-list
Reversing a linkedlist recursively in c

The following code works fine when head is sent as a parameter to it. As I am new to C, …

c recursion linked-list singly-linked-list
Sorting a linked list in C

I'm trying to sort a linked list by finding the largest value, deleting it from its position, and then inserting …

c sorting linked-list singly-linked-list
Time complexity of node deletion in singly- and doubly-linked lists

Why is the time complexity of node deletion in doubly linked lists (O(1)) faster than node deletion in singly linked …

linked-list complexity-theory time-complexity singly-linked-list doubly-linked-list
Remove duplicates from an unsorted linked list

import java.util.*; /* * Remove duplicates from an unsorted linked list */ public class LinkedListNode { public int data; public LinkedListNode next; public …

java duplicates singly-linked-list
Reversing single linked list in C#

I am trying to reverse a linked list. This is the code I have come up with: public static void …

c# reverse singly-linked-list
detecting the start of a loop in a singly linked link list?

Is there any way of finding out the start of a loop in a link list using not more than …

loops linked-list find singly-linked-list cycle-detection