Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

software development


  • Please log in to reply
1 reply to this topic

#1 jozzyjay

jozzyjay

  • Members
  • 23 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:South Africa, Durban
  • Local time:03:34 PM

Posted 23 April 2015 - 05:13 PM

hello i need an understanding with algorithm and stack function. i wanted to know that , which role does algorithm play in stack function?



BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:34 AM

Posted 24 April 2015 - 04:35 PM

A stack is a data structure where items are removed from the structure in reverse order they are added. The operation to add something to the stack is usually called "push", and the operation to remove something from the stack is usually called "pop". So you have something like:

stack s;
s.push(1);
s.push(2);
s.push(3);
s.pop(); // 3
s.pop(); // 2
s.pop(); // 1
An algorithm is any mechanism to transform data.

Many algorithms depend on stacks to do their jobs in reasonable time; but there's nothing that inherently says "algorithms must use stacks" or similar.

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users