MCIS 6214 Data Structure and Algorithms
Order ID# 45178248544XXTG457 Plagiarism Level: 0-0.5% Writer Classification: PhD competent Style: APA/MLA/Harvard/Chicago Delivery: Minimum 3 Hours Revision: Permitted Sources: 4-6 Course Level: Masters/University College Guarantee Status: 96-99% Instructions
MCIS 6214 Data Structure and Algorithms
Lab Assignment – MCIS 6214 Data Structure and Algorithms (Lab#08)
No Name, ID and section name : 2 point deduction No output is provided: 10 point deduction,
No indentation: 10 points deduction
Late Policy: 1 day per 10% deduction
Problem: The following code is an implementation of the stack operation. Complete the program to convert postfix to infix using the given C++ sample code.
Hand in:
1) A Single zipped file which contains Source code and output:
(Lab8.cpp, Lab8.h, Lab8A.h, Lab8.doc (Capture your screen shot- Don’t type ))
2) Upload two files to the Black board.
# When you upload files to the black board, those files should be compressed to one single file as attachment.( only five chances to upload)
Input
A B C * + D E / F * –
Output
(A+(B*C))-((D/E)*F))
Algorithm of Postfix to infix
1. Push post fix notation to the PostfixStack reverse order
( eg. push – * F / E D + * C B A)
2. while there are no data at PostfixStack
3. read one symbol from the PostfixStack
4. if the symbol is an operand
5. push it into the InfixStack
6. else MCIS 6214 Data Structure and Algorithms
7. pop the top 2 values from the InfixStack
8. put the operator between two operand
9. Encapsulate the resulted string with parenthesis
10. if there is only one value in the stack
That value in the stack is the desired Infix notation
#include <iostream> #include “.h”
//Include header file named “Lab8A.h“ using namespace std;
void testCopyConstructor(stackType<int> otherStack);
int main()
{MCIS 6214 Data Structure and Algorithms
// Define stacks stackType<int> stack(50);
stackType<int> copyStack(50);
stackType<int> dummyStack(100);
MCIS 6214 Data Structure and Algorithms
//Create two stacks PostfixStack type of char, InfixStack type of string. MCIS 6214 Data Structure and Algorithms
//Push post fix notation to the stack //A B C * + D E / F * –
stack.push(23);
stack.push(45);
MCIS 6214 Data Structure and Algorithms
//Function call “isOperator”
// Test function call using while loop while ( )
{
//read all contents from the PostfixStack
//call function isOperator with actual parameter
//convert a char to string using stringstream
// If a content is an opcode
if ( ) {
// push to the InfixStack
}
else
{
// Take two operand from the InfixStack and save each value to the
Variable opr1 and opr2. And concatenate opr1, operator, opr2
And enclosed with ( ) and then save to the InfixStack.
}//end if
} // end while
// Check contents of the InfixStack copyStack = stack; //copy stack into copyStack
cout << “The elements of copyStack: “;
while (!copyStack.isEmptyStack()) //print copyStack
{
cout << copyStack.top() << ” “;
copyStack.pop();
}
cout << endl;
copyStack = stack;
testCopyConstructor(stack); //test the copy constructor
if (!stack.isEmptyStack())
cout << “The original stack is not empty.” << endl
<< “The top element of the original stack: ”
<< copyStack.top() << endl;
dummyStack = stack; //copy stack into dummyStack
cout << “The elements of dummyStack: “;
while (!dummyStack.isEmptyStack()) //print dummyStack
{
cout << dummyStack.top() << ” “;
dummyStack.pop();
}
cout << endl;
system(“pause”);
return 0;
}
void testCopyConstructor(stackType<int> otherStack)
{
if (!otherStack.isEmptyStack())
cout << “otherStack is not empty.” << endl
<< “The top element of otherStack: ”
<< otherStack.top() << endl;
}
//Header file: myStack.h
Page 4 of 4
MCIS 6214 Data Structure and Algorithms
RUBRIC
Excellent Quality 95-100%
Introduction 45-41 points
The background and significance of the problem and a clear statement of the research purpose is provided. The search history is mentioned.
Literature Support 91-84 points
The background and significance of the problem and a clear statement of the research purpose is provided. The search history is mentioned.
Methodology 58-53 points
Content is well-organized with headings for each slide and bulleted lists to group related material as needed. Use of font, color, graphics, effects, etc. to enhance readability and presentation content is excellent. Length requirements of 10 slides/pages or less is met.
Average Score 50-85%
40-38 points More depth/detail for the background and significance is needed, or the research detail is not clear. No search history information is provided.
83-76 points Review of relevant theoretical literature is evident, but there is little integration of studies into concepts related to problem. Review is partially focused and organized. Supporting and opposing research are included. Summary of information presented is included. Conclusion may not contain a biblical integration.
52-49 points Content is somewhat organized, but no structure is apparent. The use of font, color, graphics, effects, etc. is occasionally detracting to the presentation content. Length requirements may not be met.
Poor Quality 0-45%
37-1 points The background and/or significance are missing. No search history information is provided.
75-1 points Review of relevant theoretical literature is evident, but there is no integration of studies into concepts related to problem. Review is partially focused and organized. Supporting and opposing research are not included in the summary of information presented. Conclusion does not contain a biblical integration.
48-1 points There is no clear or logical organizational structure. No logical sequence is apparent. The use of font, color, graphics, effects etc. is often detracting to the presentation content. Length requirements may not be met
You Can Also Place the Order at www.perfectacademic.com/orders/ordernow or www.crucialessay.com/orders/ordernow
MCIS 6214 Data Structure and Algorithms