Welcome![Sign In][Sign Up]
Location:
Search - algorithm parentheses and brackets

Search list

[Windows Develop 自动括号匹配器的设计

Description: 假设一个算数表达式中可包含三种括号:圆括号,方括号和花括号且这三种括号可以按任意次序嵌套使用。试利用栈的运算,编写判别表达式中所含括号是否正确配对出现的算法-Suppose an arithmetic expression can contain three brackets: parentheses, brackets and braces and three brackets can be nested in any order. The trial use of the computing stack, the preparation of the algorithm is correct pairing of the discriminant expression contained in parentheses appear
Platform: | Size: 1983 | Author: testsb | Hits:

[DocumentsMatching-brackets

Description: 数据结构 1、算法思路: 假设表达式中包含两种括号:圆括号和方括号,其嵌套顺序随意,即([]())或[([])]等为正确的格式,[(])或([())或(()]均为不正确的格式。检验括号是否匹配可以用堆栈来实现当遇到 ( 或 [ 时进栈,遇到 ) 或 ] 时出栈进行匹配检验,如果出现不匹配的情况立即结束,否则继续取下一个字符。如果没有遇到不匹配的情况,最后判断栈是否为空,栈为空,括号匹配,否则不匹配。 -Data Structure 1, Algorithm idea: the assumption that the expression contains two types of brackets: parentheses and brackets, the nested sequence of random, that is, or ([]()) [([])] such as the correct format, [( ]) or ([()) or (()] are not the correct format. test match brackets can be used to achieve when the stack (or [into the stack when encountered) or] when a stack test match , if the situation does not match an immediate end to, or continue to remove a character. If you do not encounter the situation does not match, the last to judge whether the stack is empty, the stack is empty, parentheses matching, otherwise do not match.
Platform: | Size: 13312 | Author: Anson | Hits:

[Otherpipei

Description: 任意输入一个由若干个圆括号、方括号和花括号组成字符串,设计一个算法判断该串中的括号是否配对。 -Enter an arbitrary number of parentheses, square brackets and curly braces composed of strings, to design an algorithm to determine the string in brackets whether the pair.
Platform: | Size: 1024 | Author: 李娜 | Hits:

[Data structs3

Description: 假设一个算术表达式中可以包含三种括号:圆括号,方括号和花括号,且这三种括号可按照 任意的次序嵌套使用,编写判别给定表达式中所含括号是否正确配对出现的算法(已知表达式已 存入数据元素部位字符的顺序表中)-Suppose an arithmetic expression can include three kinds of brackets: parentheses, square brackets and curly braces, and the three brackets can be used in accordance with any order of nesting, the preparation of discrimination contained in the given expression correctly matches appear in parentheses algorithm (known expression data elements have been deposited in parts of the order of characters in the table)
Platform: | Size: 1024 | Author: 吴立国 | Hits:

[Otherstack

Description: 假设一个算术表达式中可以包括三种括号:圆括号“(”和“)”,方括号“[”和“]”和花括号“{”和“}”且这三种括号可以按任意的次序嵌套使用(如:…[…{…}…[…]…]…[…]…(…)…)。编写判别给定表达式中所含括号是否正确配对出现的算法(已知表达式已存入数据元素为字符的顺序表中)-Suppose an arithmetic expression can include three types of brackets: parentheses " (" and " )" , in square brackets " [" and " ]" and braces " {" and " }" and this can be any of three brackets order of nested (such as: ... [... {...} ... [...] ...] ... [...] ... (...) ...). The preparation of discrimination contained in the given expression appears in parentheses matching algorithm is correct (known expression for the character data elements have been deposited in the order form)
Platform: | Size: 1024 | Author: bear | Hits:

[Windows Developjudgebrackets

Description: 假设一个算术表达式中可以包含三种括号:圆括号“(”和“)”,方括号 “[”和“]”以及花括号“{”和“}”,且这三种括号可按任意的次序嵌套使 用。该算法用于判断给定表达式中所含括号是否配对出现。-Suppose an arithmetic expression can contain three types of brackets: parentheses " (" and " )" , in square brackets " [" and " ]" and braces " {" and " }" , and can use any of these three brackets order nested. The algorithm used to determine a given expression contained in parentheses are paired appear.
Platform: | Size: 9216 | Author: 林小悠 | Hits:

[ELanguagedelimiter_matching

Description: 编写简易编译器,能发现分隔符匹配的错误如括号、注释符的匹配问题,都能检测出来-delimiter matching The simple algorithm uses a stack and is as follows: Make an empty stack. Read characters until end of file. If the character is an open anything, push it onto the stack. If it is a close anything, then if the stack is empty report an error. Otherwise, pop the stack. If the symbol popped is not the corresponding opening symbol, then report an error. At end of file, if the stack is not empty report an error. Besides the balancing of the parentheses, brackets, and braces, the Annotation (“/**/”) should be balanced. When a “/*” is found, all the letters behind will be ignored until a “*/” is found. If it is not found at the end of the file, an error will be reported. Some of the contents of the stack are shown in the figure below.
Platform: | Size: 2048 | Author: aga | Hits:

[Data structsok

Description: 顺序表的应用 (1) 已知长度为n的线性表A采用顺序存储结构,请写一时间复杂度为0(n)、空间复杂度为0(1)的算法,该算法删除线性表中所有值为item的数据元素。要求:线性表元素个数n很大,而值为item的数据元素个数很少,要求移动元素个数尽量少;删除后的数组元素与原数组元素不必保持顺序一致。 (2)编写一个函数将一个顺序表A(有n个元素,且任何元素均不为0)分拆成两个顺序表,使A中大于0的元素存放在B中,小于0的元素存放在C中。 (3)假设一个算术表达式中包含圆括号,方括号和花号三种类型的括号,编写一个判别表达式中括号是否正确配对的函数correct(exp,tag);其中:exp为字符串类型量,表示被判别的表达式,tag为布尔型的变量。 (4)编写向顺序分配的循环队列QU[0,m-1]中插入一个结点的函数enqueue和从该队列中取出一个节点的dequeue函数。 (5)编写一个主函数,调试上述算法。 -The application of the order form (1) of length n given in Table A using the linear sequence of storage structure, please write a time complexity 0 (n), space complexity is 0 (1) of the algorithm to delete all the values ​ ​ of the linear form for the item of data elements. Requirements: n number of elements in a large linear table, while the number of data elements is very little item, requiring as little as possible the number of mobile elements to delete array element after the array elements do not have to maintain the original order of the same. (2) write a function to a sequence of Table A (with n elements, and any element not 0) the order split into two tables, so that A is greater than 0 in the element is stored in B, is less than 0 elements stored in C. (3) assuming an arithmetic expression contains parentheses, brackets, and three types of flower number in parentheses, the expression in parentheses write a discriminant function correctly matching correct (exp
Platform: | Size: 2048 | Author: jay | Hits:

[Data structsparentheses-design

Description: 假设一个算数表达式中可包含三种括号:圆括号,方括号和花括号且这三种括号可以按任意次序嵌套使用。试利用栈的运算,编写判别表达式中所含括号是否正确配对出现的算法-Suppose an arithmetic expression can contain three brackets: parentheses, brackets and braces and three brackets can be nested in any order. The trial use of the computing stack, the preparation of the algorithm is correct pairing of the discriminant expression contained in parentheses appear
Platform: | Size: 2048 | Author: 陈磊 | Hits:

[CSharpshiyan2

Description: 运用栈实现表达式开、闭括号是否配对出现算法。先要实现栈的基本操作算法,包括初始化栈、进栈、退栈等。本程序中,表达式中的元素限定为char型,表达式的长度<100。表达式输入的为一个以“#”为结束标志的字符串。若用户输入的表达式中少了左括号或少了右括号,打印“括号不匹配”。若输入的表达式左右括号匹配,打印“括号匹配”。-Use stack to achieve expression open, close parenthesis pair appeared algorithm. The need to achieve the basic operation of the stack algorithm, including the initialization stack, the stack, the stack back. The program expression elements qualified for the char type expression length < 100. Expression input for a " #" marks the end of a string. User input expression less left parenthesis less a right parenthesis, print " brackets do not match." If the input expression left and right parentheses matching, print brace matching.
Platform: | Size: 1024 | Author: 陈序员 | Hits:

[AlgorithmEric

Description: 输入字符类型算式,进行四则运算,支持括号和括号嵌套,用递归算法,支持科学计数法-Enter the character type formula for four operations, support brackets and parentheses nested, recursive algorithm, support scientific notation
Platform: | Size: 495616 | Author: Eric | Hits:

[Internet-NetworkDevil-language

Description: 魔王语言: 处理括号: 先设置一个栈,遇到左括号时,不断地压栈,直到遇到右括号。一旦遇到了右括号就不断地出栈,直到出一个左括号,然后把这些字符解释,解释后压到栈里去。然后再不断地压栈,直到遇到下一个右括号,如此往复。并利用递归算法处理多重括号的情况。 翻译: 一旦遇到需要翻译的字符,输出指定的字符串。此处仅仅设置了两种规则(自行定义),因此只需按照定义过的规则输出字符串即可。-Devil language: Handling parentheses: setting a stack encounter left parenthesis, push constantly, until it encounters a closing parenthesis. Once encountered a right parenthesis to keep the stack until a left parenthesis, and then put these characters through interpretation go back pressure to the stack. Then continue to push until it encounters the next closing parenthesis, and so forth. And using a recursive algorithm to handle multiple brackets situation. Translation: Once the need to translate the characters, the output specified string. Here only set two rules (self-defined), so just follow the rules defined output string can be.
Platform: | Size: 2048 | Author: ck | Hits:

[Data structsbracelet-matching

Description: 关于算式中小括号、中括号和花括号的匹配检查算法-Match checking algorithm on small formula parentheses, brackets and braces
Platform: | Size: 1024 | Author: 林仲懿 | Hits:

[Data structszhan

Description: 栈 假设一个算术表达式中可以包含三种括号:园括号“(”和“)”、方括号“[”和“]”、花括号“{”和“}”,且这三种括号可按任意的次序嵌套使用。编写判别给定表达式中所含括号是否正确配对出现的算法(已知表达式已存入数据元素为字符的顺序表中)。要求:顺序栈存储;实现顺序栈的基本操作;调用基本操作完成。-The stack Suppose a arithmetic expressions can contain three kind of parentheses: garden \ (\ and\ ) \ , brackets, brackets \ [\ and\ ] \ , curly braces \ {\ and\ } \ , and the three brackets can be used according to the sequence of arbitrary nested. Write discriminant given expression in parentheses is properly matched the algorithm (known expression has been deposited in the data elements for the character sequence in the table). Requirements: order stack storage To realize the basic operations of stack order Call the basic operation is completed.
Platform: | Size: 6144 | Author: huangyinghao | Hits:

CodeBus www.codebus.net