postfix
-
[문제해설] 다음 수식 A/B*(C-D)+E 을 Postfix로 표현하시오.전자계산기조직응용기사/실기 필답형 기출문제 해설 2022. 5. 3. 09:23
전자계산기조직응용기사 실기 필답형 기출문제 (수식 표기법) - 2020년1회 2회 통합 다음 수식 A/B*(C-D)+E 을 Postfix로 표현하시오. - 문제해설 - "본 해설은 기사 등급의 수준을 훨씬 넘으므로, 기술사 취득에 관심 있으신 분께 권장하는 해설입니다." 우리(human)는 일반적으로 수식을 표현할 때 중위 표기법(infix notation)을 사용합니다. 하지만, 컴파일러는 그렇지 못합니다. 대신 컴파일러는 후위 표기(postfix)라고 하는 괄호를 사용하지 않는 표기법을 일반적으로 사용합니다. 다음 표에서는 중위 표기와 후위 표기에 대한 예시를 보여줍니다. 중위 표기 후위 표기 2 + 3 * 4 2 3 4 * + a * b + 5 ab*5+ ( 1 + 2 ) * 7 1 2 + 7 * ..
-
[문제해설] Infix 표기의 식 (A/(B^C))*D+E를 Postfix 방법으로 바르게 표현한 것은?전자계산기조직응용기사/필기 기출문제 해설 2021. 10. 28. 12:13
전자계산기조직응용기사 필기 기출문제 (2과목 자료구조 및 데이터통신-트리) - 2016년1회 Infix 표기의 식 (A/(B^C))*D+E를 Postfix 방법으로 바르게 표현한 것은? ① +*/A^BCDE ② ABC^/D*E+ ③ E+D*C^B/A ④ AB^/CD*E+ - 문제 해설 - 수식 표기법은 2진 트리 순회 문제와 같습니다. 단지 노드의 값들이 숫자와 연산자로 이루어져 있을 뿐입니다. 먼저 순회 방법의 대해 알아보겠습니다. 표기법 순회순서 전위(Prefix) root → left → right 중위(infix) left → root → right 후위(postfix) left → right → root 인터럽트 조건 : 순회하는 노드가 자식노드가 있을 때. 위처럼 3개의 노드로 이루어진 2진 ..
-
[문제해설] 다음 수식 A/B-C*D를 Postfix로 표시하시오.전자계산기조직응용기사/실기 필답형 기출문제 해설 2021. 10. 3. 13:31
전자계산기조직응용기사 실기 필답형 기출문제 (수식 표기법) - 2004년1회, 2007년3회, 2010년3회, 2014년3회, 2018년3회, 2019년1회 다음 수식 A/B-C*D를 Postfix로 표시하시오. - 문제 해설 - 수식 표기법은 2진 트리 순회 문제와 같습니다. 단지 노드의 값들이 숫자와 연산자로 이루어져 있을 뿐입니다. 먼저 순회 방법의 대해 알아보겠습니다. 표기법 순회순서 전위(Prefix) root → left → right 중위(infix) left → root → right 후위(postfix) left → right → root 인터럽트 조건 : 순회하는 노드가 자식노드가 있을 때. 위처럼 3개의 노드로 이루어진 2진 트리 순회는 전, 중, 후위 순회가 있으며, 그 기준은 ro..
-
[문제해설] 다음 Postfix로 표현된 수식 AB/CD×-을 Infix 표기법으로 변환하시오.전자계산기조직응용기사/실기 필답형 기출문제 해설 2021. 8. 19. 07:25
전자계산기조직응용기사 실기 필답형 기출문제 (수식 표기법) - 2010년1회, 2013년3회 다음 Postfix로 표현된 수식 AB/CD×-을 Infix 표기법으로 변환하시오. - 문제 해설 - 수식 표기법은 2진 트리 순회 문제와 같습니다. 단지 노드의 값들이 숫자와 연산자로 이루어져 있을 뿐입니다. 먼저 순회 방법의 대해 알아보겠습니다. 표기법 순회순서 전위(Prefix) root → left → right 중위(infix) left → root → right 후위(postfix) left → right → root 인터럽트 조건 : 순회하는 노드가 자식노드가 있을 때. 위처럼 3개의 노드로 이루어진 2진 트리 순회는 전, 중, 후위 순회가 있으며, 그 기준은 root 노드의 순회 순서라는 것을 알 ..