Sungsu Hur
Penn State University
Followers: 0 Following: 0
Feeds
已解决
Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.
19 days 前
已解决
Parcel Routing
Given a matrix that represent the distance along highways between major cities numbered 1 to _N_, provide the path and shortest ...
19 days 前
已解决
Graph Algorithms 3: Number of Connected Components
Given an adjacency matrix of a simple undirected graph, find the number of connected components.
19 days 前
已解决
FloydWarshall
Our task is to find shortest paths between every pair of nodes. Floyd-Warshall is a graph algorithm for finding shortest paths i...
19 days 前
已解决
Count the Number of Directed Cycles in a Graph
Given an asymmetric adjacency matrix, determine the number of unique directed cycles. For example, the graph represented by adj...
19 days 前
已解决
Determine connected components of a graph
Adjacency matrix of an undirected graph is given. Return the number of connected components in the graph.
19 days 前
已解决
Mirror Image matrix across anti-diagonal
Given an input number x, create a mirror image matrix 'Y' across the anti-diagonal. For example, if x=3, Y = [1 2 3; ...
19 days 前
已解决
Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
For example, if n=2 (maximum value), the output matrix should be [1 1 1 1 1; 1 2 2 2 1; 1 2 1 2 1; 1 2 2 2 1; 1 1 ...
19 days 前
已解决
Spot the rectangle
This problem is related to the 17x17 challenge. Given a matrix filled with ones and zeros, determine whether or not any rectangl...
19 days 前
已解决
Spot the rectangle (Part 2)
This problem is related to the 17x17 challenge. See also Part 1 of this problem. Given a matrix in which each element is either ...
19 days 前
已解决
Symmetric matrix
You must create a n-by-n symmetric matrix such that A(row,col) = row/col for col >= row. Example if n =3 : output is : A = ...
19 days 前
已解决
Pascal's Matrix
Given an integer n ≥ 0, generate the ( _n_+1) × ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...
19 days 前
已解决
Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...
19 days 前
已解决
Create a random vector of integers with given sum
Your task today is to write a function that returns a vector of integer numbers, between, and including, 1 and m, of which the s...
19 days 前
已解决
Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A; Output: A=(Aij),where each entry Aij is either...
19 days 前
已解决
Roll the Dice!
Description Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. Example [x1,x2] = rollDice(...
19 days 前
已解决
Given n, create n random numbers such that their standard deviation is also n.
Given n, create n random numbers such that their standard deviation is also n.
19 days 前
已解决
Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...
19 days 前
已解决
Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the second...
19 days 前
已解决
Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return true if the triangle with sides a, b and c is right-...
19 days 前
已解决
Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? Image courtesy of Wikipedia.
19 days 前
已解决
Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...
19 days 前
已解决
Given a square and a circle, please decide whether the square covers more area.
You know the side of a square and the diameter of a circle, please decide whether the square covers more area.
19 days 前
已解决
Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
19 days 前


