Matheesha Prathapablog.webnex.cloud·Jul 22, 2024Quantum ComputingQuantum computing is rapidly emerging as one of the most transformative technologies of our time. In simple terms, classical computers make calculations in binary (0s and 1s), whereas quantum computers use the principles of quantum mechanics to incre...DiscussFuture of Technologybinary
Filip Melkafilipmelka.hashnode.dev·Jul 19, 2024The Hidden Bug in Binary SearchThe following code is my very first implementation of Binary Search in Java (which returns the index of the target element in the array): public static int binarySearch(int[] arr, int target) { int start = 0; int end = arr.length - 1; int...Discuss·1 likeBinary Search Algorithm
Shaikh Farisfaristheprogrammer.hashnode.dev·Jul 17, 2024Mastering Binary Search: A Complete GuideWhat is binary search? Binary search is a searching algorithm which is used to search for an element in an array. It is a very effective algorithm and reduces time by a great margin. Why use binary search when we have linear search? Binary search has...DiscussDSA Seriesalgorithms
Ayush ThakurforInterview Bitsinterviewbits.hashnode.dev·Jul 15, 2024Constructing a Binary Tree from Preorder and Inorder TraversalOne of the fascinating challenges in binary tree problems is reconstructing the tree from its traversal data. In this post, we will discuss how to construct a binary tree given the preorder and inorder traversal arrays. Problem Statement Given two in...DiscussPython
Anower Hossainanower77.hashnode.dev·Jul 14, 2024Segment Tree-1Segment Tree Basic Node Divide With Segment Tree Node Numbering (Segment Tree) // build (node, begin, end) build (1, 1, N) { L = 2xN, R = (2xN) + 1 // Node Number Calculate mid = (begin + end) / 2 left = (L, begin, mid) left = (R, ...Discuss·91 readssegment-tree
Vineeth Chivukulavineethchivukula.hashnode.dev·Jun 28, 2024Solving Binary SearchTo see the question, click here. Naive Approach The idea is to search the entire array to find the target. So, if the target is found, return the index; otherwise, return -1. // TC: O(n) // SC: O(1) public class BinarySearch { public int search(...DiscussBinary Search Algorithm
Animesh Kumaranimeshk.hashnode.dev·Jun 26, 2024Organizing Your Closet: A Lesson from Binary SearchLast evening, I spent a lot of time looking for my formal wear. It made me realize that if I had organized my closet beforehand, finding my clothes would have been much quicker and easier. This situation reminded me of the Binary Search algorithm fro...Discuss·1 like#TechBlogging
Marcos Motamarcosmota.com·Jun 26, 2024Implement a Binary Tree in GolangThe biggest challenge in Computer Science is transforming a data structure that has a complexity of O(n) to O(log n), this is not an easy journey. In this post we will discover how the binary tree does this (at least tries to) and implement this data...Discussgolang
Akshaya Biswalakshaya-biswal.hashnode.dev·Jun 26, 2024Binary SearchBinary Search is a way to find an element's position in a sorted array. In this method, the element is always searched in the middle of a part of the array. Code: Iterative Approach def binary_search(array, x, low, high): # Repeat until the poin...DiscussAlgorithmsDSA
Vineeth Chivukulavineethchivukula.hashnode.dev·Jun 24, 2024Understanding the Modified Binary Search TechniqueModified binary search is a versatile technique used to efficiently search for elements in sorted arrays or lists or solve problems that involve finding a specific value or condition in a sorted context. The standard binary search algorithm is modifi...DiscussBinary Search Algorithm