Blog
Find Odd Occurring Element
In this coding question, we find the odd-appearing element using bitwise xor. This algorithm is simple yet powerful.
Swap Two Numbers
In this coding question, we input two numbers and swap them without using the swapping logic.
Bitwise XOR, Computations, and Examples
A Bitwise XOR is a binary operation that takes two-bit patterns of equal length and performs the logical exclusive OR operation on each corresponding bits pair. Each position’s result is 0 if both bits are 0 or if both bits are 1. Otherwise, the result is 1.
Introduction to XOR
The Bitwise XOR operator is denoted by ^. When an XOR gate is given with 2 inputs, the corresponding outputs will be: If two input bits are different, the output is 1. In all other cases, it is 0.
Solution Review: Power of 2
Let's solve this using brain kernighan's algorithm. This is optimized to O(1) time and space.
Solution Review: Check If a Given Number is Even/Odd
This is a solution to another Bitwise question. Think of the rightmost bit of a number and think of some logic that could solve this. We solve using AND operator with O(1) time Complexity.
Solution Review: Count Set Bits Or Number of 1 bit's
We saw an algorithm to solve this problem in the previous lesson. Let’s see how to solve this more efficiently using Briann’s Algorithm. This is a faster execution than the previous naive approach.
A Complete Guide To JavaScript LocalStorage
localStorage is a property of the window object in JavaScript that allows you to store key/value pairs in a web browser. The data stored in localStorage persist even after the browser is closed, making it a useful tool for saving user data on the client side.
Is Java "pass-by-reference" or "pass-by-value"?
Java uses pass-by-value for all parameters, including both primitive data types and objects, which affects how methods behave and how they should be written.
How to reverse the letters in a string in Java
In this article, we'll learn various ways to reverse strings in Java. An algorithmic approach with a flow chart and steps. Using java API methods to solve this problem and rotate kth elements or characters in an array.