This post explains how to solve leetcode problem – 21. merge two sorted list – using python 3. Let’s take a look at an example. Let’s say there are two lists: 1 -> 3 -> 5 and 2 -> 4. After merging those lists, the expected answer is 1 -> 2 -> 3 -> 4 READ MORE
Month: May 2023
LeetCode 206. Reverse Linked List
This post explains leetcode problem 206. reverse linked list using python 3. For example, let’s say there is a linked list: 1 -> 2-> 3-> 4 -> 5. After reversing the list, the expected result is 5 -> 4 -> 3 -> 2 -> 1. This is a fairly easy problem and there is a READ MORE
Minimum Spanning Tree – Kruskal’s Algorithm
This post explains what minimum spnning tree is and how to construct minimum spanning tree using Kruskal’s algorithm What is minimum spanning tree Given you have a list of nodes in a graph and weighted edges connecting the nodes. What is the minimum cost to connect the nodes that all the nodes are connected? For READ MORE