Search:

Type: Posts; User: wu_weidong

Search: Search took 0.01 seconds.

  1. 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>
  2. 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...
  3. 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. 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. 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. 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. 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...
  8. Replies
    1
    Views
    1,042

    Simulation Problem

    Hi all, I have a simulation problem.

    A phone line connecting 2 cities only operates from 8AM to 12AM (16 hours) everyday. Customers in these 2 cities randomly make phone calls through it. The...
Results 1 to 8 of 8