Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5fef1af

Browse files
committed
removed unused method from stack class
1 parent1c9ce7e commit5fef1af

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

‎src/Stack.ts‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,9 @@ class Stack<T = any> {
3131
returnthis.#top;
3232
}
3333

34-
getlength(){
35-
returnthis.#top;
36-
}
37-
3834
toArray(){
3935
return[...this.#data];
4036
}
41-
42-
fromArray(data:any){
43-
this.#data=data;
44-
}
4537
}
4638

4739
exportdefaultStack;

‎src/infixToPostfix.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function infixToPostfix(str: string) {
5353
history.push({stack:stack.toArray(),postfix:[...postfix], char});
5454
}
5555

56-
while(stack.length!==0)postfix.push(stack.pop());
56+
while(!stack.isEmpty())postfix.push(stack.pop());
5757
history.push({stack:[],postfix:[...postfix],char:""});
5858

5959
return{ history, postfix};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp