Infix expression yog dab tsi?
Infix expression yog dab tsi?

Video: Infix expression yog dab tsi?

Video: Infix expression yog dab tsi?
Video: Infix, Prefix and Postfix 2024, Kaum ib hlis
Anonim

Ib infix qhia yog ib tsab ntawv, lossis tus neeg teb xov tooj, ua los ntawm ib qho infix txoj hlua thiab ua raws li lwm tus infix txoj hlua.

Tom qab, ib tug kuj yuav nug, dab tsi yog infix qhia nyob rau hauv cov ntaub ntawv qauv?

Infix , Prefix thiab Postfix Cov lus qhia . Thaum koj sau lej lej kev qhia xws li B * C, daim ntawv ntawm cov kev qhia muab cov ntaub ntawv rau koj kom koj txhais tau raug. Hom kev sau no yog hu ua infix vim tus neeg teb xov tooj nyob nruab nrab ntawm ob lub operands uas nws ua haujlwm rau.

Qhov thib ob, koj yuav daws qhov kev qhia infix li cas?

  1. tsim ib pawg neeg ua haujlwm khoob.
  2. tsim ib qho khoob operand pawg.
  3. rau txhua tus token nyob rau hauv txoj hlua input. a. tau tus token tom ntej hauv txoj hlua infix. b.
  4. Thaum tus neeg teb xov tooj pawg tsis khoob, tus neeg teb xov tooj pop thiab operands (sab laug thiab sab xis), ntsuas tus neeg teb xov tooj sab laug thiab thawb cov txiaj ntsig mus rau operand pawg.
  5. pop tshwm sim los ntawm tus neeg teb xov tooj pawg.

Ib yam li ntawd, nws yog nug, dab tsi yog infix thiab postfix kab zauv?

Infix qhia : Cov kev qhia ib op b. Thaum tus neeg teb xov tooj nyob hauv-nruab nrab ntawm txhua khub ntawm operands. Postfix qhia : Cov kev qhia ntawm daim ntawv b op. Thaum tus neeg teb xov tooj tau ua raws rau txhua khub ntawm operands.

Dab tsi yog qhov kev qhia ua ntej?

Ua ntej : Ib kev qhia yog hu ua prefix qhia yog hais tias tus neeg teb xov tooj tshwm nyob rau hauv lub kev qhia ua ntej cov operands. Tsuas yog ntawm daim ntawv (operator operand1 operand2). Muab ib Prefix qhia , hloov nws mus rau hauv Postfix kev qhia.

Pom zoo: