Skip to content

Instantly share code, notes, and snippets.

View xerZV's full-sized avatar

Nikolay Simitchiyski xerZV

View GitHub Profile
@dim4o
dim4o / interview.md
Last active September 8, 2019 08:42
interview

Linked list

Problems:

  • Find the middle element of a linked list. Can you do the work with one pass over the list? See here.

  • Reverse a linked list. Can you reverse the list with O(1) space complexity? See here.

  • Given a singly linked list, determine if it is a palindrome. Could you do it in O(n) time and O(1) space? See here.

  • Given a linked list, determine if it has a cycle in it. Can you solve it using O(1) memory? See here.