Skip to content

Commit aaac994

Browse files
authored
Update README.md
1 parent 611ffef commit aaac994

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
# CodingProblems
1+
# Coding Challenges
2+
### This repository contains various coding challenges taken on Sites like HackerRank, LeetCode etc.
3+
4+
##Challenge#1- Perfix Notation
5+
#### Write a function that evaluates an expression written in Prefix Notiation and returrns a value
6+
* Problem Statement:
7+
Prefix notation (also known as polish notation) is an alternative to the more familier infix notation.
8+
9+
In infix notation, operators(add,multiply,etc) are written between their operands(number, variables, or sub-expression).
10+
* In prefix notation, operators are written before their operands
11+
Some examples follow of expression in infix notation and their equivalents in prefix notation.
12+
In this example the operator is + and its operands are 1 and 2:
13+
14+
```
15+
Infix expression: 1 + 2
16+
Prefix expression: + 1 2
17+
Value: 3
18+
```
19+
20+
In this example, the sub-expression + 1 2 is the first operand of the + operator
21+
22+
```
23+
Infix expression: (1+2) * 3
24+
Prefix expression: * + 1 2 3
25+
Value: 9
26+
```

0 commit comments

Comments
 (0)