Linked Lists

Categories: Code Problem / Data Structures and Algorithms / Recursion (32) Code Problem / Data Structures and Algorithms / Binary Search (30) Code Problem / Data Structures and Algorithms / Linked Lists (26) Code Problem / Data Structures and Algorithms / Backtracking (26) Code Problem / Data Structures and Algorithms / Stacks and Queues (25) Code Problem / Data Structures and Algorithms / Hashing (24) Databases / SQL / Backup and Recovery (19) Code Problem / Data Structures and Algorithms / Arrays and Strings (19) Databases / SQL / Database Normalization (18) Code Problem / Data Structures and Algorithms / Time Complexity (17) Databases / SQL / Locking (16) Databases / SQL / Replication (15) Databases / SQL / SQL Queries (13) Code Problem / Data Structures and Algorithms / Graphs (13) Databases / SQL / Database Security (13)  More...

Recent solutions:

Check these solutions from our community:
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem deals with reversing a linked list. The input is a list of nodes, and the output should be the list of nodes in reverse order.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The approach is not clear.
Dec 13
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This technical problem involves removing duplicate elements from a singly linked list. An example input is given, as well as the expected output.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The approach is not clear.
Dec 09
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This technical problem deals with singly linked lists, and specifically with checking if a given singly linked list is a palindrome. A palindrome is defined as a word, phrase , or sequence that reads the same backward as forward, and so in this context, a palindrome linked list would be one where the order of the nodes is the same whether you traverse the list from the beginning or from the end. The input to the function is a singly linked list, and the output is a boolean value indicating whether or not the list is a palindrome.
About this solution: The candidate's solution correctly implements a function to check if a singly linked list is a palindrome. The candidate uses a stack to store the data from the first half of the list, then compares the data in the second half of the list to the data in the stack. If the data doesn't match, the list is not a palindrome. The candidate's solution is complete and correctly solves the problem. The candidate's approach is sound.
Dec 08
Code Problem / Data Structures and Algorithms DifficultyMedium Python
This problem asks you to reverse a singly linked list. An example input is given as 1->2->3->4->5, and the expected output is 5->4->3 ->2->1.
About this solution: The candidate's solution correctly implements a solution to reverse a singly linked list, both iteratively and recursively. The iterative solution is more efficient, however, both solutions are correct. The candidate demonstrates a good understanding of linked lists and how to reverse them.
Dec 07
Code Problem / Data Structures and Algorithms DifficultyMedium C#
This problem deals with reversing a linked list. An example input is given as 1 -> 2 -> 3 -> 4, and the corresponding output would be 4 -> 3 -> 2 -> 1.
About this solution: The candidate's solution does not demonstrate a level of completeness and does not solve the problem. The approach is not clear.
Dec 07
Code Problem / Data Structures and Algorithms DifficultyMedium JavaScript
Write a function that takes a linked list as input and returns the second to last node in the list.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The approach is also optimal, as it only requires one pass through the list.
Dec 06
Code Problem / Data Structures and Algorithms DifficultyMedium C++
Given a singly linked list, this function returns the middle node of the list. If the list has an even number of nodes, the function returns the node at the start of the second half of the list.
About this solution: The candidate's solution is complete and solves the problem. The candidate's approach is to create a linked list from the given vector data, print the list, and then find the middle node of the list.
Dec 05
Code Problem / Data Structures and Algorithms DifficultyMedium C++
This problem asks you to reverse the order of a linked list. For example, if the given linked list is 1->2->3->4->5, the output should be 5-> 4->3->2->1.
About this solution: The candidate's solution correctly reverses the nodes in a linked list. The approach is clear and easy to follow.
Nov 29