* Support vector machines analysis are supervised learning models that analyze data, and are used for classification analysis and regression analysis. * The minimization function is the error of how much misclassified points are there in the model(graph), (either inside the margins or of course outside of them), and alsoContinue Reading

This algorithm produces an unbiased permutation: every permutation is equally likely. Shuffling an array of n elements in C++: void fisherYatesShuffling(int *arr, int n_elements) { int shuffled_array[n_elements]; int ind_taken[n_elements]; for (int i = 0; i < n_elements; i++) ind_taken[i] = 0; int index; for (int i = 0; i < n;Continue Reading

Applying (pre multiplying) a matrix to a vector gives you either a rotation or a scale(strech/compress) or both a scale(strech/compress) and a rotation. This is called vector transformation, and the  (pre multiplying)  matrix is called the transformation matrix. No Rotation Case(Pure Scaling ; EigenValue/Eigen Vector) When a vector transformation byContinue Reading

The Euclidean algorithm is based on the principle that the greatest common divisor (GCD) of two numbers does not change if the larger number is replaced by its difference with the smaller number. This is repeated with successive smaller pairs of numbers until they both are equal, which in thatContinue Reading

Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution. Example: Given array nums = [-1, 2, 1, -4], and target = 1. The sum thatContinue Reading

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. Example: Given array nums = [-1, 0, 1, 2, -1, -4], A solution set is: [ [-1, 0, 1], [-1,Continue Reading

Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Example 1: Input: [“flower”,”flow”,”flight”] Output: “fl” Example 2: Input: [“dog”,”racecar”,”car”] Output: “” Explanation: There is no common prefix among the input strings. Note: All givenContinue Reading