Tree

Binary TreeInterview Questions1. Lowest Common Ancestor of a Binary TreeMore Questions Binary Tree Interview Questions 1. Lowest Common Ancestor of a Binary Tree More Questions Perform in-order, pre-order, and post-order…

Starting node of cycle in Linked List

Starting node of cycle in Linked ListProblem StatementHashing TechniqueComplexityFloyd’s Cycle Detection AlgorithmFast and Slow Pointer TechniqueComplexity Starting node of cycle in Linked List Problem Statement Given the head of a linked list,…

Palindrome Linked List

Leetcode#234 Palindrome Linked ListProblem StatementGolang Solution - 1Recursion method Solution -2 Palindrome Linked List Problem Statement Given the head of a singly linked list, return true if it is a  palindrome  or false otherwise. Example 1:…

Linked List

Linked List Interview questionsMore Questions Linked List Interview questions Remove Nth Node From End of List Palindrome Linked List Detect Cycle in a Linked List Starting node of cycle in…

Remove Nth Node From End of List

Leetcode#19 Remove Nth Node From End of ListNaive Golang solutionLogicOptimised simple CodeMinor improvementExplanation of ChangesWhy Dereferencing HelpsKey Changes and Why ?Example Test Cases Remove Nth Node From End of List…

Reverse Linked List

Reverse Linked ListProblem StatmentIterative ApproachGolang solutionOutputRecursive ApproachGolang SolutionOutput Reverse Linked List LeetCode#206 Problem Statment Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input:…

Recursion and Backtracking

RecursionBacktrackingSubSequencePick or Not pick technique Recursion package main import ( "fmt" ) func printNameNTimes(name string, i int, N int) { if i > N { return } fmt.Printf("%s\n", name) printNameNTimes(name,…