add to front for both linked list and array-based?
And when you say delete from last, do you mean locate array position, shift value one position towards the end of array? Or locate position, then...
Type: Posts; User: ee1215
add to front for both linked list and array-based?
And when you say delete from last, do you mean locate array position, shift value one position towards the end of array? Or locate position, then...
When inserting data value into unsorted linked list, where is most efficient to add the new data value? Before first element? After last element?
When Inserting into unsorted array-based list,...
Ok, so looks like the Push(S,12) , Enqueue(Q,'A') and such I will not be using.
These are multiple choice questions. Nothing to do with coding. Here is an example of the first question and the others are almost identical:
Suppose that a client function contains a variable S...
I have two different questions for each, Stack and Queue.
1) Variable S of type Stack. Add the value 12 to the stack S.
So, I believe the answer would be S.Push(12);
-What is the difference in...
Could someone please look over my questions/answers that I have put in bold. Or the answer I put after A:. I am preparing for a test and want to make sure I know what to do. Thanks
1) Client...
Here is my correction for Push and Pop.
Implement Push
void Stack::Push(int n)
if (IsFull())
throw StackFull();
else
{
Not my code, for each question there are 4 code options to choose from and also 'none of the above'. So for those, pop and push, I have chose the incorrect one. When I get back I will try to chose...
Read the other posts. This is not code I am testing. Those 1-7 were questions are dealing with the header file up top.
Correct. Just had to chose between four sample codes provided or None of the above, because it is a multiple choice question. Are the others correct except Pop?
Implement Pop
int Stack::Pop()...
The header code was provided and the questions 1-7 were multiple choice questions I had to answer. I am not writing specific code, just using the header to write a few functions. Just wanted to check...
I am preparing for a test and have answered some questions dealing with stacks and queues the teacher has provided as samples. Could someone check over my work?
// stack.h – complete header...
I have. I commented, in the bottom code part, what I am trying to do in the if statement and else statement. For the else, I have while loop but confused on what statement will be in it. I tried to...
I have wrote most of my Enqueue function but need help on a small part of it.
struct Node
{Node* nextPtr; Node* previousPtr; Message data;}
class Priority
private: {Node* frontPtr; Node*...