Rashakil Fol 978 Super Senior Demiposter Team Colleague

Quite frankly, this site is the worst dating service I've seen. ;-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

...

Why are you taking the class if not to learn?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Back when I had no clue what "object oriented" meant, I looked at C# and was able to make reasonable applications with it. It's a comfortable language.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Which part of the logic and the sequence do you not know how to do?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

system() function takes a lot of time to execute.

So?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Is the IRC Chat network up? I'm having trouble connecting to irc.daniweb.com.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You might check Qt. Qt is a graphical C++ compiler for the Xwindow environment in Linux...

A compiler? I thought it was a library. And it's a GPL'ed library, forcing all your code to be GPL, as well. If you want the non-GPL'ed version, you have to fork over thousands of dollars.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Generally speaking, I think things would be improved with a normal font size, better contrast for all text, and for buttons. Using black instead of gray would help.

With all the gray, low-contrast colors and such, the site seems to be a bit of a ghost town.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

There was once this gal named cscgal.
She thought and exclaimed, "Be a millionaire, I shall!"
Then one day, she counted up her money,
Her sequins, her gaint stones, and all her honey.

It summed past a million, and so cscgal cheered,
"I'm a millionaire. I shall be revered!"
And so the crowds gasped, and the horses reared,
But the time of her enlightenment ever so neared.
"You're not a real millionaire," one fat cat sneered.
"We use the sum towards which dollars are geared!"

And so cried the cscgal. She cried and cried and cried and cried,
And cried and cried, and nearly died,
And just a few times, she yelled,
A word that could not be succinctly spelled:

"Noooooooooooooooooooooooooooooooooooooooo
ooooooooooooooooooooooooooooooooooo
ooooooooooooooooooooooooooooooooooooooooooo
ooooooooooooooooooooooooooooooooooooooo!"

But then it came to her mind,
That her money was not lost to someone unkind,
That it was still hers and it was still the same,
That silly titles and words could not alter her fame.

And so she decided, to stand derided.
She stood presided, while others deprided.
And so she had rearranged the rankology,
So others learnt her newfound philosophology.

~s.o.s~ commented: Exotic, wonderful and a classic. :) +21
Rashakil Fol 978 Super Senior Demiposter Team Colleague

I'd go with interpretation b, since the third bullet says "Return the Hamiltonian Cycle ..." which means that the algorithm ends there. The fourth and fifth bullets are just informative.

Why don't you ask the person who gave you this assignment? Unless there is no such person.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I noticed that if I visit the 'Web development' forum index, the background turns blue (and ugly).

That's all for today!

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Pretend you're the computer, and keep track of the values of money and moneyspent given some arbitrary input values to the program. You'll see your problem.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
if (nums[start] > nums[end])
             {
                 int temp = nums[start];
                 nums[start] = nums[end];
                 nums[end] = temp;
             }

Since end can iterate down to zero, the comparison can result in swappage in the wrong direction. Here's what happens.

When this algorithm is run, the value 'start' ends up dragging up the least element with it. That is, in the middle of your algorithm, your array might look something like this:

2
3
4
1
7  start
6
8
5
9 end

Then, while 'end' iterates downwards, it puts the smallest element between 'start' and 'end' into the position beneath 'start'. In this case, it swaps 5 with 7, and no more swaps are made.

2
3
4
1
5 start
6  ^
8  |
7 end
9

Then 'end' reaches the position just before 'start'. Since nums[start] > nums[end], the two are swapped.

2
3
4
5 end (after swapping)
1 start
6
8
7
9

Then 'end' reaches -1 with no further swapping (because nums[start] contains the minimum element), leaving the beginning region sorted. Then the loop restarts, with 'start' incremented.

2
3
4
5
1
6 start
8
7
9 end

And it happens all over again...

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Better at what? What are you using the processors for?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I don't see what the problem is with causing a few radio frequencies to become unusable. Internet access is a much better use of that portion of the spectrum.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Ah! I was wondering if I was reading that wrong :)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

A method based on continued fractions will get you the answer in less than a millisecond.

(Ooh I'm being so unhelpful :twisted: )

Rashakil Fol 978 Super Senior Demiposter Team Colleague

In my high school, a referral meant that the kid got in trouble. This does not necessarily mean he did anything wrong.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Use a recurrent relation. Or don't.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Linear search performs O(N) comparions in the worst case, and O(N/2) comparisons in the average case.

In a related note, linear search also performs O(N/10000) comparisons in the average case!

Rashakil Fol 978 Super Senior Demiposter Team Colleague

byt the way, why douse RAND_MAX exist if it cant be set? is there another reason?

RAND_MAX doesn't 'exist', for some definitions of the word. It just happens to be a fact that rand() will return a value that is less than or equal to whatever value RAND_MAX denotes. It's not a variable in memory; it gets replaced with a regular old number by the compiler. For example, my compiler replaces it with the value 2147483647. The value you get depends on the random number generator your version of rand() uses.

Rashakil Fol 978 Super Senior Demiposter Team Colleague
for (int pass = 0; pass < arraysize - 1; pass++)

		for (int loop = 0; loop < arraysize - 1; loop++)
			
			if ( a[ loop ] < a [ loop + 1] )
				increasing = 1; 
	
	if (increasing == 1) 
			cout << "The array is increasing.";

	else
			cout << "The array is not increasing. ";

How does using a nested for loop change anything? What is the purpose of the outer loop; it just runs the innerloop (arraysize - 1) times without changing anything.

Your code sets 'increasing' to 1 if any pair of elements is increasing. This means that for increasing to be still not equal to 1 (assuming you initialized it with some value beforehand), every pair of elements would have to be in non-increasing order. This means that if increasing is not 1, then your array is in descending order (or at least non-increasing order, where some successive elements can be equal).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Interestingly enough, your link brings this page back as a result! I like the other Daniweb match a bit more, though.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I think the answer to time complexity is :
nm+n+m+2

but I can't give the Big Oh for it .

Don't worry about the other poster.

Your answer for the time complexity is generally correct. The question is, do you know what Big O notation really means?

It is used to compare growth rates between functions. Hopefully, you know what it means for one function to grow faster than another. If a function f grows slower than or equal to a function g defined by g(x) = x^2, we would say that f is in O(x^2). For example, if f(x) = 3x^2, then their growth rates are equal, hence O(x^2) is an upper bound for f. O(x^3) would be another valid upper bound, since 3x^2 grows slower than x^3. But saying O(x^2) is tighter and more informative.

You have found a correct formula for the running time of your algorithm. If you wanted, a cheapo growth bound for your algorithm could be O(nm+n+m+2). Your function certainly grows at the same rate as or slower than itself. But it can be shown using some math that f(x,y) = xy grows at the same rate as xy+x+y+2, so the growth bound of O(nm) works, too.

Formally, big-O notation represents sets of functions -- the set of all functions that grow slower than or equal to the contained expression (using a certain definition of "slower than or equal to"). For example, O(n^2) is a set of functions that …

Rashakil Fol 978 Super Senior Demiposter Team Colleague

That happens if they don't teach it in the first year, if you've switched your major. And when searching on Google, you get three companies calling themselves Big-O Tires, a site Big-O dot com, a Wikipedia article incohesively written by fifty people with their heads up some mathematical rectum, some small government page with a poor explanation, a fan page of a televesion show, and two books -- one about orgasms, the other about basketball.

Then on the second page, we've got a movie, a birding festival, a magazine, some boats, ....

Why are you posting hateful things?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

He either throws a nickel first or a dime first. The number of ways to pay is equal to the number of ways to pay by throwing a nickel first added to the number of ways to pay by throwing a dime first.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I Need To Write A Program Using Pascal To Calculate Coinage I.e 1 X 20p, 3 X 5p Etc. Im New To This And Need Urgent Help. :-| :-| :-| :-| :-|

Use a text editor?

HTH.... :-|

Rashakil Fol 978 Super Senior Demiposter Team Colleague

It uses deprecated header names and it doesn't output the answer.

Also, you have a variable and a function with the same name. That's making the compiler confused. Rename your variables and such so that they do not collide.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

I think it's real. That is, no laws of physics have been disobeyed, nobody square-rooted a negative number, and that really is a video, not some puny animated GIF.

When he tapped the paper to show how the glass behind it was 'solid,' it actually sounded like there was nothing behind the paper.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

This depends on the datastructure you are using to represent the graph.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Note that DMR's only vote happened because I felt uncomfortable with the number 69999 :-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague
Rashakil Fol 978 Super Senior Demiposter Team Colleague

http://search.cpan.org/dist/Win32-OLE/lib/Win32/OLE.pm#Methods

$comp = Win32::OLE->new("ADODB.Recordset");

The 'new' method returns undef on failure; that's what's happening. Now you need to figure out why it is failing, since I don't know the particulars of this module, and you can read documentation as well as I can.

use strict; use warnings;

to avoid errors and ugliness (always).

Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you don't post the code that is causing this problem, people are unlikely to be able to help you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

lol Im passed that already. I declared my variables in header files that I coded. Im looking for atleast a hint on how to get the program to respond to user input so that I can execute the action from a declared variable.

This is what if statements are for.

if (x == "add") {
    add_routine();
}
else if (x == "sub") {
    subtraction_routine();
}
.
.
.
Rashakil Fol 978 Super Senior Demiposter Team Colleague

If you go that route, make it real-time with "AJAX." (Otherwise the project could take less than 10 lines of code.) Then write a tetris in Python, and run it over the Javascript console. :-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

There is a function in C++ that does what you want. But it might not have been written for you. So you're going to have to write it yourself.

You should also try figuring out _exactly_ what you are trying to do. Right now, you are being ambiguous. After all, a string is already a stream of bits! Also, your example of converting "A" to 1010 makes no sense to me at all. Why would "A" be converted into the stream 1010?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Use a 'for' loop. Show what you think works, and tell us exactly what each line does and why.

In doing this, you'll probably solve your problem, but if that fails, you'll have people here willing to help you.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Which way are you trying to build the list? Are you trying to have the most-recently entered element be at the front of the list, or are you trying to have the most-recently entered element be at the end of the list. Right now, it looks like you want the former, but since you appear very confused, I have to ask.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

You shouldn't have $Dog::obj be a package global there. Make it a local variable in _init.

Your getColour, getName subroutines are returning the attributes of whatever hash reference is contained in $Dog::obj. This happens to point to the hash of whatever Dog was initialized most recently. They should return the attributes of their passed argument, @_[0], instead.

Perl packages do not work the same way as C++ classes.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

What about pointers...anything pointed by pointers???.....if possible by example

Consider a structure of the form

struct dog {
    type_1 val_1;
    type_2 val_2;
    type_3 val_3;
    .
    .
    .
    type_n val_n;
};

The expression "x = y;", where x and y are of type struct dog, could be written as the following:

x.val_1 = y.val_1;
x.val_2 = y.val_2;
x.val_3 = y.val_3;
.
.
.
x.val_n = y.val_n;

So pointers would get copied, yes. They would contain the same memory address.


Remember that in C++ (but not C), structures can have copy constructors, which change this.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

When a structure is assigned, passed, or returned, the copying is done monolithically....what does this monolithic mean
any example??

It means that every member variable gets copied over.

For example, this C code:

#include <stdio.h>

struct cat {
    int id_num;
    int age;
    int HP;
    int MP;
};

int main(void) {

    struct cat x;
    struct cat y;

    x.id_num = 1; x.age = 2; x.HP = 3; x.MP = 4;

    y = x;

    /* Now y.id_num == 1, y.age == 2, ... */

    printf("%d %d %d %d\n", y.id_num, y.age, y.HP, y.MP);
    /* Prints "1 2 3 4\n" */

    return 0;
}
Rashakil Fol 978 Super Senior Demiposter Team Colleague

I think you want front and back to be of type node*.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Besides, I don't know about you, but the only time I look at anything that says "About" is to get a version and build number. ;)

About that. I noticed that your website's about.html page doesn't specify your version and build number.

Being a little hypocritical, aren't we? ;-)

Rashakil Fol 978 Super Senior Demiposter Team Colleague

When you write "example," what exactly do you mean? You're not going to be given the answer.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

Narue must mean a different thing by best case then (than what I usually mean).

Given one way to interpret the term, the best case for search is O(1) in both the balanced and unbalanced cases. This happens when the root node contains what we're looking for. The best case for insertion and deletion in a balanced tree is still O(log n).

The best case for insertion, and deletion in an unbalanced tree is O(1).

If you average the runtime of these operations over all the keys in the tree, and measure this runtime, then Narue's statements are correct, and that is probably the measurement she was implying.

Anyway, this message is for the other poster, not Narue, since Narue knows what she's talking about. (Hopefully, now hider also knows what Narue's talking about.) Anyway, hider, you'll have to decipher what they mean on your midterm as to what they are measuring when discussing runtimes.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

The input to be given to this software are using binary numbers, that is 1 and 0. This is a 429 data bus ( dont know how many of you know of that) It is the data bus used to transfer signals to and fro from onboard avionics system on the aircraft. Now suppose i have a lat = 31.998 degrees, and I need to import it in to binary format. It has to be 0010011 or something to that effect. I need a software/or program that can conver this. Tried a cpl of methods but they arenot working, cause the answers are not matching to the trial value that I have.
Thanx for the answer

You don't know what format the onboard system expects the binary numbers to be in?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

:!: I am tryin to convert latitudes and longitude values from degrees to binary. Does any one know of a method to do this. I am having a hard time with it. I have a plane trackin software that only intakes 429 signals. And am trying to move it around by inputing different signals, but it doesnt seem tohelp.
Any assistance will be appreciated.

What do you mean, 'binary'? I don't know of any units of angle measurement called binary.

Wouldn't your data already be represented in binary, because that's how everything in a computer is represented?

Rashakil Fol 978 Super Senior Demiposter Team Colleague

hi
please i am confused with bst complexity

what is the complexity for

Wait a second. You can't ask for a complexity without giving us algorithms. You've only explained the function of the algorithms, not the implementation. You haven't asked if you want a worst-case, average-case, or best-case value.

Generally speaking, the worst-case runtime for sanely-written search, insertion, and deletion algorithms is O(h), where h is the height of the tree.

Rashakil Fol 978 Super Senior Demiposter Team Colleague

We can't see the problem until we see what you've tried. Just telling you the answer wouldn't do any good, of course.