# Search:

Type: Posts; User: wu_weidong

## Search: Search took 0.01 seconds.

by wu_weidong
Replies
1
Views
1,098

### Finding determinant

Hi,
I'm trying to write a program that finds the determinant of a matrix A recursively, however, I keep getting error messages.

My code:

#define n 3
#include <stdio.h>
#include <math.h>

by wu_weidong
Replies
16
Views
2,613

### O(n) algorithm

Hi all,
I am supposed to design an O(n) algorithm that solves the following problem.

Input: An integer v and 2 sorted arrays A and B, each having n integers.
Output: Yes if and only if there...

by wu_weidong
Replies
1
Views
1,078

### Running time

Hi all,
My question is as follows:

Implement a database to maintain the total of all continual assessment marks awarded to students for the next semester. Students start with 0 marks at the...
4. ## Thread: Simulating printf function

by wu_weidong
Replies
2
Views
2,315

### Simulating printf function

Hi all,
I have to write a function named print, which simulates the library function printf, which has the following header:
void print(const char *fmt, ...);
It should be able to deal with "%d",...
5. ## Thread: Simulation - M(RT)^2 method

by wu_weidong
Replies
4
Views
1,272

### srand48() seeds the random-number generator. ...

srand48() seeds the random-number generator.
drand48() returns a random number in the range of 0 to 1. However, I don't think drand48() is usable except in a UNIX environment, which I'm using to...
6. ## Thread: Simulation - M(RT)^2 method

by wu_weidong
Replies
4
Views
1,272

### Simulation - M(RT)^2 method

Hi all,
I'm supposed to generate random variates using the M(RT)^2 method, for p(x) ~ pi - x + x^2 + sin(x), for 0 <= x <= pi. I normalised p(x) to get p(x) = [6/(12 + 3pi^2 + 2pi^3)]*(pi - x + x^2...
7. ## Thread: Simulation - Composition method

by wu_weidong
Replies
1
Views
1,797

### Simulation - Composition method

Hi all, this question doesn't really have to do with C, but it is related to simulation, and without solving this first, I can't do the random variate generator.

I'm supposed to generate random...