Press "Enter" to skip to content

Posts tagged as “Java”

Swap Node Pairs

Ajk 0

Hello again everyone! Been sometime since I wrote here. Today I wanted to take a peek at a simple Linked List problem – Swap Node Pairs. Took me a bout…

Mergesort implementation

Ajk 0

I was asked to write a simple merge-sort implementation as the initial warm-up part of an interview. (Meaning knowing how to implement merge-sort is a must-have requirement rather than an…

Reverse Integer

Ajk 0

Today we are going to be visiting a very simple problem, which need some basic maths though. Given an integer, reverse it and return the reversed integer. Sample runs are:…

Find Longest Path in Tree

Ajk 0

Today’s question is going to be a quick one. We want to find longest path in tree. What does Path mean in a Tree context? The Tree wikipedia page and…

Print all sets of factors

Ajk 7

Today we will take a look at a problem I personally got asked in an interview! It is called “Print all sets of factors”. Basically, we will try to write…

Longest common subsequence

Ajk 0

After my last DP problem, I thought I would try another one. In this problem we are asked to find the longest common subsequence of chars between two words. I…

Minimum edit distance

Ajk 0

Today I finally decided to write down a dynamic programming question. It’s very cliche and gets asked a lot in interviews. Given two words we want to find the minimum…