A blog posting problems and tutorials for blog visitors to practice and gain experience.
AD1
Saturday, 11 August 2018
Tuesday, 10 July 2018
Neural Network Tutorial
this tutorial about classifiation in machine learning -using neural network- about patient medical record data for Pima Indians and whether they had an onset of diabetes within five years
Friday, 22 June 2018
Wednesday, 30 May 2018
Side Diagonal
Statement
Given an integer- The positions on the minor diagonal (from the upper right to the lower left corner) receive
1. - The positions above this diagonal recieve
0. - The positions below the diagonal receive
2.
Solution
Friday, 11 May 2018
The diagonal parallel to the main
Statement
Given an integer- On the main diagonal write
0. - On the diagonals adjacent to the main, write
1. - On the next adjacent diagonals write
2and so forth.
Print the elements of the resulting array.
sample
n=7 | 0 1 2 3 4 5 6 1 0 1 2 3 4 5 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 2 5 4 3 2 1 0 1 6 5 4 3 2 1 0 |
Saturday, 28 April 2018
Unique elements
Given a list of numbers, find and print the elements that appear in the list only once
example
input:
4 3 5 2 5 1 3 5
output:
1
2
4
example
input:
4 3 5 2 5 1 3 5
output:
1
2
4
Saturday, 20 January 2018
Implementing Linear Regression Algorithm in Python
in this PDF created by me , a short and good introduction into one of the most popular machine learning algorithms it is called Linear regression
in this tutorial we deal with linear regression with single variable
check attached file
Linear Regression.PDF
Friday, 22 December 2017
Saturday, 23 September 2017
Monday, 18 September 2017
Matrix Transpose
Given a 2D array A, your task is to convert all rows to columns and columns to rows.
Input:
First line contains 2 space separated integers, N - total rows, M - total columns.
Each of the next N lines will contain M space separated integers.
Output:
Print M lines each containing N space separated integers.
Constraints:
1≤N≤10
1≤M≤10
0≤A[i][j]≤100 where 1≤i≤N and 1≤j≤M
Solution
Input:
First line contains 2 space separated integers, N - total rows, M - total columns.
Each of the next N lines will contain M space separated integers.
Output:
Print M lines each containing N space separated integers.
Constraints:
1≤N≤10
1≤M≤10
0≤A[i][j]≤100 where 1≤i≤N and 1≤j≤M
Solution
Saturday, 16 September 2017
Count frequency of each element in array
Write a program to count the frequency of each element in array , as example if we have
int a[10]={5, 10, 2, 5, 50, 5, 10, 1, 2, 2};
the output should be
number frequency
5 3
10 2
2 3
50 1
1 1
int a[10]={5, 10, 2, 5, 50, 5, 10, 1, 2, 2};
the output should be
number frequency
5 3
10 2
2 3
50 1
1 1
Tuesday, 22 August 2017
Friday, 18 August 2017
Friday, 14 July 2017
Wednesday, 12 July 2017
Tuesday, 11 July 2017
Saturday, 8 July 2017
Friday, 7 July 2017
Subscribe to:
Posts (Atom)