


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Due date: 6 th^ March 2017, during class only (assignment hardcopy)
Weighting: Part of 10% of overall assessment.
Environment: You are required to do this assignment in C++ environment.
Assessment
Your assignment will be assessed for the following: Correctness of the programs Sample test data/results/output or discussion of results No plagiarism
Submission
You are required to submit documentation in the form of printed copy of your codes and sample test data. Your submission should bind together with a BLACK tape with the assignment cover given at the end of this assignment question. Use RED colour paper as your Assignment 1 cover.
Warning
Write a program to determine the address of memory locations allocated to various variables as follows:
and then output the address of each variable.
subtracting the address of the first variable from the address of the second variable of the same type.
size of the memory location allocated to each type.
Checking balanced parenthesis can be solved without using a stack; In fact a simple integer variable can be used. Describe how, and write a program that uses your method to solve the problem.
Tips! Problem Solving: To check whether a given string containing brackets is correct or not (balanced or unbalanced).
and then from that point, move backward to the first occurrence of open bracket, then cut that portion of string.
we cannot do any more search (Unbalanced parentheses).
Example of the second implementation
(()) Original string (()) First search, found ) at index 3 (()) Go back, found ( at index 2 () Delete that portion of string () Second search, found ) at index 2 () Go back, found ( at index 1