Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement the vbs stack class

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to implement the vbs stack class, Xiaobian thinks it is quite practical, so share it for everyone to make a reference, I hope you can gain something after reading this article.

The problem of data structure is very important. If you can describe the input and output data structure of a problem, then this problem is very promising. Data structure is not patented by C language. The real data structure is pseudocode. The stack class below is the code I collected from others before. In fact, whenever you think about a program problem, especially a complex program, you should think about what kind of data to describe your input and output.

'**********************************************

' vbs stack class

' push(string)

' getTop fetches the top element of the stack

' pop remove top element of stack

' isempty Is the stack empty

' isfull Whether the stack is full (pMax set the size, can be modified)

'**********************************************

class Stack

private pArr, pString, pMax

private tab

private sub class_initialize()

tab=chr(9)

pMax=1000 'maximum capacity

end sub

private sub class_terminate()

if isarray(pArr) then

erase pArr

end if

end sub

public function push(str)

if str"" and instr(str,tab)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report