Nizamuddin Siddiqui

Nizamuddin Siddiqui

1,958 Articles Published

Articles by Nizamuddin Siddiqui

Page 3 of 196

Python - Image Classification using keras

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 25-Mar-2026 434 Views

Image classification is a fundamental computer vision task that categorizes images into predefined classes. Keras provides powerful tools to build convolutional neural networks (CNNs) for this purpose. There are two main approaches ? Training a small network from scratch Fine tuning the top layers of the model using VGG16 Setting Up the Environment First, we import the necessary libraries and define basic parameters ? # Importing all necessary libraries from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense from keras import backend ...

Read More

Python - How and where to apply Feature Scaling?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 25-Mar-2026 328 Views

Feature scaling is a crucial data preprocessing step applied to independent variables or features. It normalizes data within a particular range, ensuring all features contribute equally to machine learning algorithms. Why Feature Scaling is Important Most datasets contain features with vastly different magnitudes, units, and ranges. For example, age (20-80) versus income (20, 000-100, 000). Machine learning algorithms that use Euclidean distance treat these differences literally ? import numpy as np from sklearn.preprocessing import StandardScaler # Example: Age vs Income (unscaled) data = np.array([[25, 50000], [30, 75000], [35, 100000]]) print("Original data:") print("Age | Income") for ...

Read More

How to search in a row wise increased matrix using C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 252 Views

Searching in a row-wise sorted matrix is a common algorithmic problem where each row and column is sorted in ascending order. The naive approach of scanning all elements takes O(M×N) time complexity, but we can optimize this using a smart traversal strategy. The key insight is to start from either the top-right corner or bottom-left corner of the matrix. From the top-right position, if the target is smaller than the current element, move left; if larger, move down. This approach eliminates either a row or column in each step. Algorithm The search algorithm works as follows − ...

Read More

How to find all unique triplets that adds up to sum Zero using C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 452 Views

The three-sum problem involves finding all unique triplets in an array that sum to zero. This is a classic algorithmic challenge that can be solved efficiently using a two-pointer technique after sorting the array. Problem Statement Given an array of integers, find all unique triplets where nums[i] + nums[j] + nums[k] = 0. The solution must avoid duplicate triplets. Approach 1: Brute Force The simplest approach uses three nested loops to check every possible combination of three elements − Time Complexity − O(n³) Space Complexity − O(1) Approach 2: Optimized Two-Pointer Technique ...

Read More

How to find the shortest distance to a character in a given string using C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 436 Views

Finding the shortest distance to a character in a string requires calculating the minimum distance from each position to the nearest occurrence of the target character. This can be efficiently solved using a two-pass approach that scans the string from left to right and then from right to left. The algorithm maintains two arrays to track distances from both directions, then combines them to find the minimum distance at each position. Syntax Following is the method signature for finding shortest distances − public int[] ShortestDistanceToCharacter(string s, char c) Parameters s − ...

Read More

How to find the unique triplet that is close to the given target using C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 287 Views

The Three Sum Closest problem asks us to find a triplet of numbers in an array whose sum is closest to a given target value. This problem uses the Two Pointers pattern and is similar to the Triplet Sum to Zero problem. We iterate through the array, taking one number at a time as the first element of our triplet. For each fixed element, we use two pointers to find the best pair that makes the triplet sum closest to the target. At every step, we save the difference between the triplet sum and the target, comparing it with ...

Read More

How to find all the unique quadruplets that is close to zero using C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 304 Views

Finding all unique quadruplets that sum to zero in C# is a classic algorithmic problem known as the 4Sum problem. The goal is to find all combinations of four distinct elements from an array whose sum equals zero, avoiding duplicate quadruplets. Problem Approaches There are multiple approaches to solve this problem, each with different time and space complexities − Approach Time Complexity Space Complexity Description Brute Force O(n4) O(1) Four nested loops checking all combinations HashSet Optimization O(n3) O(n) Use HashSet to find fourth element Two ...

Read More

How to find the quadruplet that is close to target using C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 203 Views

The quadruplet closest to target problem involves finding four numbers in an array whose sum is closest to a given target value. This is solved using the Two Pointers pattern, similar to the quadruplet sum to zero approach. The algorithm works by sorting the array first, then using nested loops to fix the first two elements, and applying the two-pointer technique to find the optimal third and fourth elements. At each step, we track the difference between the current quadruplet sum and the target, keeping the closest sum found so far. Algorithm Steps Sort the ...

Read More

How to generate pascals triangle for the given number using C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 190 Views

Pascal's Triangle is a triangular number pattern where each number is the sum of the two numbers directly above it. The triangle starts with 1 at the top, and each row begins and ends with 1. Pascal's Triangle has many applications in mathematics, statistics, and combinatorics, particularly for calculating binomial coefficients and combinations. Each row represents the coefficients of the binomial expansion (a + b)^n, where n is the row number starting from 0. The triangle demonstrates beautiful mathematical properties and patterns that make it useful in various computational problems. Pascal's Triangle (5 rows) ...

Read More

How to check whether you are connected to Internet or not in C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 1K+ Views

There are several ways to check whether a machine is connected to the internet in C#. The most common approach uses the System.Net namespace, which provides methods for sending and receiving data from resources identified by a URI. The WebClient or HttpClient classes are particularly useful for this purpose. The technique involves making a request to a reliable URL and checking if the response is successful. Google's http://google.com/generate_204 endpoint is commonly used because it returns a minimal response, making it efficient for connectivity checks. Using WebClient for Internet Connectivity Check Example using System; using System.Net; ...

Read More
Showing 21–30 of 1,958 articles
« Prev 1 2 3 4 5 196 Next »
Advertisements