Helping engineers with technical interviews

Tag: LinkedList Page 1 of 3

Leetcode 463 Island Perimeter

Find the nth Node from the end of a Linked List

The problem of finding the nth node from the end of a linked list involves finding the node that is n positions away from the end of the linked list. For example, if the linked list has 10 nodes and n is 3, we need to find the 3rd node from the end of the […]

Read More
Leetcode 463 Island Perimeter

Check if a Linked List is a Palindrome

A palindrome is a sequence of characters that is read the same forward and backward. For example, “racecar” is a palindrome. In the context of a linked list, we can consider it a palindrome if the sequence of values in the list is the same when read from left to right and from right to […]

Read More
Leetcode 463 Island Perimeter

Detect and Remove a Loop in a Linked List

A linked list is a data structure in which each element in the list, known as a node, contains a value and a reference to the next node in the list. Here’s an example of a linked list: In this list, each node contains a value and a reference to the next node in the […]

Read More

Linked lists vs Arrays: Comparing Advantages, Disadvantages, and Trade-Offs

Data structures are an essential part of computer science, and they play a critical role in designing efficient algorithms. Two of the most commonly used data structures are arrays and linked lists. While both of these data structures are used to store and manipulate collections of data, they differ in their implementation and functionality. In […]

Read More
Learn linkedlist implementation in ruby

Ruby LinkedList Class Tutorial: Implementation and Usage

Ruby has a built-in linked list class called LinkedList, which is part of the enumerator package. The LinkedList class is a linear data structure that consists of a sequence of nodes, where each node contains a data element and a reference to the next node in the list. Here is an example code to create […]

Read More
Leetcode 463 Island Perimeter

Remove duplicates from a sorted linked list.

Given a sorted linked list, write a function to remove all the duplicate elements from the list, such that each element appears only once. Example: Input: 1 -> 1 -> 2 Output: 1 -> 2… Read More

Read More
Learn linkedlist implementation in ruby

Linked list implementation and operations in Ruby

In Ruby, a linked list is a data structure that consists of a sequence of nodes. Each node in the list contains a data element and a reference (or pointer) to the next node in the sequence. The first node is called the head of the list, and the last node is called the tail […]

Read More

Introduction to skip list: An advanced LinkedList

Skip lists are a probabilistic data structure that uses multiple levels of linked lists to provide efficient search and insertion operations. Each node in a skip list has multiple forward pointers, allowing for efficient traversal of nodes that are farther away from the current node. Skip lists are designed to improve the efficiency of search […]

Read More

Java LinkedList Class Implementation Guide and Examples

LinkedList is a linear data structure that is used to store a collection of elements. It is a sequence of nodes, where each node contains an element and a reference to the next node in the sequence. The first node in the sequence is called the head of the list, while the last node is […]

Read More
Leetcode 463 Island Perimeter

Sort a linked list using shared pointer

Linked lists are commonly used data structures in computer programming. Linked lists consist of nodes that are dynamically allocated, meaning that memory must be manually managed. Memory management can be a complex and error-prone task, and to make it easier, shared pointers are used in linked list implementation. Shared pointers are smart pointers that help […]

Read More

Page 1 of 3

Powered by WordPress & Theme by Anders Norén