Forum: C++ Sep 25th, 2007 |
| Replies: 3 Views: 1,519 Sorry~~, I don't know where to post this quetion.
Can someboy help me with this question, plz....
Suppose someone designed a stack abstract data type in which the top function returned an... |
Forum: Assembly Dec 6th, 2006 |
| Replies: 5 Views: 5,639 sorry, i don't know which forum i should post this question.
Q) a machine language program to input 2 numbers then adds 2 numbers then output the single-character result.
this is what i got so... |
Forum: C Oct 27th, 2006 |
| Replies: 8 Views: 2,321 thanks guys for all your help~
I love this website.... |
Forum: C Oct 26th, 2006 |
| Replies: 8 Views: 2,321 ok...i did change it to "binarySum[8]".
and if i also change
for (i=0; i<8; i++) overflow[i] = 0;
for (i=8; i >= 0; i--)
{
binarySum[i] = binary1[i] + binary2[i] + overflow[i];
if (... |
Forum: C Oct 26th, 2006 |
| Replies: 8 Views: 2,321 #include <stdio.h>
#include <iomanip>
int main()
{
int binary1[8] = {0,1,1,1,1,0,1,1}; //8 element array
int binary2[8] = {1,0,1,0,1,1,1,1}; //8 element array
int binarySum[9]; |
Forum: C Mar 30th, 2006 |
| Replies: 4 Views: 2,912 i guess using the quick sort partition function. |
Forum: C Mar 30th, 2006 |
| Replies: 4 Views: 2,912 Trace the Partition function on the following array:
[0] [1] [2] [3] [4] [5] [6]
'F' 'K' 'A' 'R' 'C' 'Y' 'G'
Assume that ChoosePivot returns without doing anything (the... |
Forum: C Mar 29th, 2006 |
| Replies: 5 Views: 2,205 hmm...i'm still confused!!
so the answer for the first question is "64"??
and the answer for the 2nd question is "24" or "16"?
i hate taking on-line classes.... |
Forum: C Mar 29th, 2006 |
| Replies: 5 Views: 2,205 It's from my homework assignment
Question 1)
Based on the O notation, approximately how many swaps and comparisons occur when Selection sort is called on a worst-case array of length 8?
a) 16 ... |
Forum: C++ Mar 25th, 2006 |
| Replies: 3 Views: 1,784 What is the O-notation for the following code?
cin >> N;
for (int count = 1; count <= N; count++)
{
for (int count2 = 1; count2 <= count; count2++)
} |
Forum: C++ Mar 24th, 2006 |
| Replies: 11 Views: 5,107 Thanks for your help Narue...you have a great weekend.
thanks again. |
Forum: C++ Mar 24th, 2006 |
| Replies: 11 Views: 5,107 if you look at my original question, i stated that "The Base class has a public member function mem() that is not virtural. The member function mem() is redefined in class Derived."
the base class... |
Forum: C++ Mar 24th, 2006 |
| Replies: 11 Views: 5,107 no, i don't think i made any mis typo on the second question...i double checked with my homework sheet...maybe the professor made a mistake.
Base *dPtr = new Derived;
dPtr -> mem();
In the... |
Forum: C Mar 24th, 2006 |
| Replies: 1 Views: 941 The class Chevrolet inherits from the class Automobile. Both have implemented a function called DownShift(). Suppose carPtr is declared as: Automobile *carPtr;
The carPtr object can point to... |
Forum: C++ Mar 24th, 2006 |
| Replies: 11 Views: 5,107 oops~ sorry.
i made a typo on the first question....is that mean the answer is "C"
c) typedef ourClass* ourClassPtrType;
ourClassPtrType ourClassPtr;
ourClassPtr = new ourClass;
d)... |
Forum: C++ Mar 23rd, 2006 |
| Replies: 11 Views: 5,107 I have no clue what the answer is.
Which of the following dynamically allocates an object of type ourClass?
a) ourClass ourPtr;
ourPtr = new ourClass;
b) ourClass ourClassObj = new... |
Forum: C Mar 22nd, 2006 |
| Replies: 3 Views: 1,052 Class B
{
public:
int e();
void f();
private:
int x;
};
class D: public B |
Forum: Computer Science Feb 24th, 2006 |
| Replies: 4 Views: 9,982 Consider the language in the alphabet {a,b} defined by the grammar.
<S> = a<S>a | b<S>b | a | b
Question: List all the 5-character strings that are in this language.
My answer is there are... |
Forum: C Feb 24th, 2006 |
| Replies: 2 Views: 1,787 That's what I got too....the fourth one is "-.." which already exist so it doens't count.
I have another question and this one is little harder.
<S> = a<S>a | b<S>b | a | b
Q: list all... |
Forum: C Feb 23rd, 2006 |
| Replies: 2 Views: 1,787 How do i get from 2 character words to 4 character words or 5 character words??
can anyone show me how to do that plz...
Q) Consider a language of words, where each word is a string of dots and... |
Forum: C Feb 14th, 2006 |
| Replies: 2 Views: 1,877 |
Forum: C Feb 14th, 2006 |
| Replies: 2 Views: 1,877 This is one of my hw question and I can't find the answer from the textbook.
Question: A function that modifies an array by pointer arithmetic (e.g., ++ptr) to process every value should have a... |
Forum: C++ Nov 15th, 2005 |
| Replies: 4 Views: 2,918 Question: counts how many times the number 5 appears in array called NumArray?
Can anybody help me with this problem??
I got 4 "5s" but i don't know if i understood the question correctly or... |
Forum: C++ Nov 8th, 2005 |
| Replies: 2 Views: 1,373 |
Forum: C++ Nov 8th, 2005 |
| Replies: 2 Views: 1,373 can't find where the error occurs using debugger? any help plz~~
//this program computes how much money will
//accumulate after so many years of investing
#include <iostream>
using... |
Forum: C Nov 8th, 2005 |
| Replies: 2 Views: 1,379 |
Forum: C Nov 8th, 2005 |
| Replies: 2 Views: 1,379 class Thing {
public:
int Item;
Thing (int Value);
Thing (int Value1, int Value2);
int GetValue1 () const;
int GetValue2 () const;
private: |