Computer Science Homework Solutions
Problem
#109061

C++

C++. See attached file for full problem description.

Attached file(s):
Attachments
Question 11.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Question 11.doc




O(1)



O(n)



O(log n)



O(n^2)





  Question 12



  template

void linkedStackType::linkedOperation1()

{

      nodeType *temp;

      if(stackTop!=NULL)

      {

            temp=stackTop;

            stackTop=stackTop->link;

      delete temp;

      }

      else

            cerr<<"ERROR"<
}





push



pop



top



copy





  Question 13



  template

void linkedStackType::linkedOperation1()

{

      nodeType *temp;

      if(stackTop!=NULL)

      {

            temp=stackTop;

            stackTop=stackTop->link;

      delete temp;

      }

      else

            cerr<<"ERROR"<
}





The stack is full



The stack is empty



The element does not exist



The stack is nonempty but not full









stackTop



stackTop - 1



0



-1





  Question 15



  #include

#include "myStack.h"

using namespace std;

int main()

{

      stackType intStack(50);

      stackType tempStack;

      intStack.push(18);

      intStack.push(21);

      intStack.push(25);

      tempStack = intStack;

      while(!tempStack.isEmptyStack())

      {

            cout<
            tempStack.pop();

      }

      cout<
      cout<
      return 0;

}





18



21



25



50





  Question 16



  template

Type stackType::operation2()

{

      assert(stackTop != 0);

      return list[stackTop - 1];

}





top



pop



push



isEmptyStack









Two



Three



Four



Five









num



count



sizeOf



size









modulation



comparison



analysis



simulation









operations



lists



customers



servers




Solution
What is this?
By OTA - Overall OTA Rating
Yupei Xiong, PhD - 4.8/5
Purchase Cost Now
$2.19 CAD (was ~$23.94)
Included in Download
  • Plain text response
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse