Tags » Linked List

Design Phone Directory


Design a Phone Directory which supports the following operations:

  1. get: Provide a number which is not assigned to anyone.
  2. check: Check if a number is available or not.
  3. 360 more words
Algo & Code (leetcode / C++)

Linked List implementation in C#

Definition: A linked list is a linear collection of data elements, called nodes, each pointing to the next node by means of a pointer. It is a… 346 more words


[Leetcode] Merge K Sorted Lists


Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.


problem page


Use a min heap where at the first stage the heap consists of head nodes of lists. 137 more words

Interview Algorithms

Leetcode 2. Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit.

290 more words

Leetcode 160. Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins.

For example, the following two linked lists:

A:          a1 → a2
                     c1 → c2 → c3
B:     b1 → b2 → b3
215 more words

Leetcode 21. Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.

155 more words

Leetcode 25. Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.

If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.

268 more words