Check for Balanced Parentheses using Stack?
If the current character is a starting bracket ('(' or '{' or '[') then push it to stack. If the current character is a closing bracket (')' or '}' or ']') then pop from stack and if the popped character is the matching starting bracket then fine else brackets are not balanced.
| Is This Answer Correct ? | 0 Yes | 0 No |
class Alpha { public: char data[10000]; Alpha(); ~Alpha(); }; class Beta { public: Beta() { n = 0; } void FillData(Alpha a); private: int n; }; How do you make the above sample code more efficient? a) If possible, make the constructor for Beta private to reduce the overhead of public constructors. b) Change the return type in FillData to int to negate the implicit return conversion from "int" to "void". c) Make the destructor for Alpha virtual. d) Make the constructor for Alpha virtual. e) Pass a const reference to Alpha in FillData
Name the debugging methods that are used to solve problems?
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
List the special characteristics of constructor.
What are namespaces in c++?
What is insertion sorting?
Explain linked list using c++ with an example?
Is c++ a float?
How to implement is-a and has-a class relationships?
What is a container class? What are the types of container classes in c++?
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
What are c++ templates used for?