LogicLabs

© 2025 LogicLabs

DSA

Browse all articles in this category

Bubble sort algorithm using iteration
over 2 years ago

Procedure: If ar[j] > ar[j+1] then swap those elements When doing this, we'll observe that the largest element is going to the last of the array after every iteration. So there are n-i-1 elements that get sorted at the end of the array after each it...

Find the Middle element of a LinkedList
about 3 years ago

Question: Middle of the Linked List For odd length Linkedlist, we'll be having only one middle element, while for the even length, we'll have 2 middle elements. In the question, they asked to return the 2nd node if there are 2 middle elements. Step-...

Construction of Binary Search Tree in Python
about 3 years ago

Insertion into BST or Construction of BST in both recursive and iterative approach Construction of BST is easy than it seems to be 🌻. We know that, the nodes which are less than the root are present in the left subtree and all the nodes which are gr...