Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~7K People Reached
Favorite Tags
c x 15
c++ x 10
Member Avatar for jack223

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 b) 64 c) 100 d) 800 Number of swaps = O(n) which is "8" and Number of …

Member Avatar for Adak
0
147
Member Avatar for jack223

[code] #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]; int overflow [9]; int i; for (i=0; i<9; i++) overflow[i] = 0; for (i=9; i >= 0; i--) { binarySum[i] = binary1[i] + binary2[i] + overflow[i]; …

Member Avatar for harunosakura
0
1K
Member Avatar for jack223

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 eight 5-character strings in this language and they are ababa abbba aaaaa aabaa baaab …

Member Avatar for MrMarko
0
196
Member Avatar for jack223

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 access path (or pointer), rather than returning a copy of the top element. This is not true data …

Member Avatar for vijayan121
0
182
Member Avatar for jack223

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 far but it doesn't work..any help plz~~ [code] 0000 4900FE ;Get input from the user …

Member Avatar for Day Brown
0
2K
Member Avatar for jack223

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 purpose of the function it to move the pivot to the leftmost position in the subarray, so by doing nothing …

Member Avatar for Narue
0
207
Member Avatar for jack223

What is the O-notation for the following code? [code] cin >> N; for (int count = 1; count <= N; count++) { for (int count2 = 1; count2 <= count; count2++) } [/code] a) O (log N) b) O (N) c) O (N^2) d) O (N^3) outer loop is O(N) …

Member Avatar for WolfPack
0
93
Member Avatar for jack223

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 ourClass; c) typedef ourClass* ourClassPtrType; ourClassPtrType ourClassPtr; ourClassPtr = new ourClassPtrType; d) typedef ourClass* ourClassPtrType; ourClassPtrType ourClassPtr; ourClassPtr = …

Member Avatar for jack223
0
179
Member Avatar for jack223

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 both a Chevrolet or an Automobile. We want the call carPtr -> DownShift() to call the right version of DownShift based on …

Member Avatar for Narue
0
92
Member Avatar for jack223

[Code] Class B { public: int e(); void f(); private: int x; }; class D: public B { public: void h(); void g(); private: float y; } [/code] How many public methods does class D have? is it 2 or 4? void h(), void g() and i'm not sure about …

Member Avatar for Lerner
0
91
Member Avatar for jack223

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 dashes. The following grammar describes this language: <word> ::= <dot> …

Member Avatar for jack223
0
158
Member Avatar for jack223

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 parameter that is? a) a nonconstant pointer to nonconstant data b) a nonconstant pointer to …

Member Avatar for jack223
0
117
Member Avatar for jack223

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 not....does "55" counts as two 5s??? and if it does then how do i count …

Member Avatar for geekbutproud
0
2K
Member Avatar for jack223

can't find where the error occurs using debugger? any help plz~~ [code] //this program computes how much money will //accumulate after so many years of investing #include <iostream> using namespace std; float Balance = 0.0; float Interest; float YearlyCont; int NumYears; //this function computes one year of investment float newBalance(float …

Member Avatar for jack223
0
128
Member Avatar for jack223

[code]class Thing { public: int Item; Thing (int Value); Thing (int Value1, int Value2); int GetValue1 () const; int GetValue2 () const; private: int DataItem1; int DataItem2; void SetValue1 (int Value); void SetValue2 (int Value); }[/code]<< moderator edit: added [url=http://www.daniweb.com/techtalkforums/misc.php?do=bbcode#code][inlinecode][co[u][/u]de][/co[u][/u]de][/inlinecode][/url] tags >> How many member functions does class Thing have? …

Member Avatar for jack223
0
117