文章目录 1.题目 2.数据结构与算法 3.源代码 4.时间复杂度 5.结论 1.题目 括号匹配:给定一个表达式含有(),[],{}3种括号,验证是否匹配。 2.数据结构与算法 DS:stack Algorithm:嵌套递归 3.源代码 #include "stdafx.h" #include <iostream> #include <string> #include <stack> using namespace std; //括号匹配 bool isValid(string str){ int len = str.size(); stack<char> s; for (int i=