I have to compute a solution for a System of Nonlinear Equations using Newton's Method.
Does anybody have an idea how the algorithm may look like?
Type: Posts; User: Delia
I have to compute a solution for a System of Nonlinear Equations using Newton's Method.
Does anybody have an idea how the algorithm may look like?
I don't know what programming language it is. I found the solution here: Craig A. Rich--Programming Contests
I have a solution on the internet from my problem and I can't figure out how I can translate it in C (parts of it)
for i in reverse 1..n-1 loop
if d(e(i).u) = 1 or else d(e(i).v) =...
It's a question from my DSA exam: Suppose you have n integers in the range from 0 to n^2-1. Explain how to sort them in O(n) time.
What algorithm should I use to sort n numbers between 0 - n^2-1 in O(n) time?
I took it step by step
for i=1
first loop o(1), second o(n-1), third o(2)*o(2)*...*o(n) ---> that is o(n*n!)
for i=2
first loop o(1), second o(n-2), third o(3)*...*o(n)
and so on
for...
I''ve tried to calculate it...
My answer was O(n^2)
What is the worst case running time, in big-Oh notation, of the following program?
int function(int n)
{
r=0;
for (i=1; i<n; i++)
It did clarify a lot. Thanks!
That's not true... The fact that I ask means that I'm interested. And no, they weren't properly explained at school. I bought 3 books written by my proffesor about Data structures and algorithms, so...
What can I use as a hash function here?
But the isbn is unique for one book, a data can't have two isbns. Or two data, the same isbn.
Or what "hash the same thing/choose for the hash" means?
I have up to 10,000 such data:
typedef struct
{
char authors[5][40]; // first and last names of the author
char title[50]; // title of the publication
unsigned int year; // year of the...
I have the following functions :
typedef struct
{
char authors[5][40]; // first and last names of the author
char title[150]; // title of the publication
unsigned int year; // year of...
Allocating memory. Thanks.
I have the following structure and I have to initialize the field authors with a null string.
I get segmentation fault when I reach the second step
strcpy(pItem->authors[1],"");
...
I'm geeting segmentation fault also if I use this. "Cannot acces memory at adress ..."
--- SOLVED ---
I have the next 2 structures:
typedef struct
{
char authors[5][40]; // first and last names of the author
char title[50]; // title of the publication
unsigned int year; // year of the...
I have include the header "SLList.h" into another heather "A1P01.h".
I got the error: No such file or directory.
Why?
I've tried to copy the adress too and I got the same error.
Solved.
The problem is that I don't know how many authors do I have,It can vary from 1-5. So I don't know how many times I have to use strok before entering the next area of fileds.
eg.:
"Knuth, Donald...
I don't know how to do it. I have a separation area between the authors and the rest of the fields ",,,".
I need some ideas how I can divide the fields.
My idea was that I first use...
I have as an assigment to create as a library the next structure:
typedef struct
{
char authors[5][40]; // first and last names of the author
char title[50]; // title of the publication...
It works. Thanks.
This is were I create my list
ListDT *createDList()
// returns a pointer to the header cell of the created list
{
ListDT *List=(ListDT*) malloc( sizeof (ListDT) );
if (List != NULL)
typedef struct nodeD
{
void *Item; // pointer to satellite data
struct nodeD *next; // pointer to next cell
struct nodeD *prev; // pointer to previous cell
} NodeDT; // type of cells on the...