473,695 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

implementation of stack

9 New Member
implementation of stack using arrays
Aug 14 '07 #1
6 2537
this is kiran
9 New Member
implementation of stack using linked lists
Aug 14 '07 #2
this is kiran
9 New Member
how to write a program using stack in python, i know the concept but not able to write a python code for it. could you please show me a sample program.
Aug 14 '07 #3
2,851 Recognized Expert Moderator Specialist
implementation of stack using arrays
A simple example:
Expand|Select|Wrap|Line Numbers
  1. >>> import array
  2. >>> a = array.array('i')
  3. >>> for i in range(10):
  4. ...     a.append(i)
  5. ...     
  6. >>> a
  7. array('i', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
  8. >>> for i in range(10):
  9. ...     print a.pop()
  10. ...     
  11. 9
  12. 8
  13. 7
  14. 6
  15. 5
  16. 4
  17. 3
  18. 2
  19. 1
  21. >>> a
  22. array('i')
  23. >>> 
Aug 14 '07 #4
6,596 Recognized Expert Expert
implementation of stack using linked lists
This you your LAST WARNING, my friend.
  1. Tripple posting
  2. Poorly formulated question
  3. No effort to show that you have done any work
It's all in the Posting Guidelines.
One more infraction will result in a one week ban on your account.
Thank you for your attention in this matter.
Aug 14 '07 #5
this is kiran
9 New Member
thank you very much this is really help full for me
Aug 15 '07 #6
this is kiran
9 New Member
thank you, i must follow those
Aug 15 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Chris Cranford | last post by:
I am in the process of implementing a stack machine virtual environment where each entry on the stack is a 32-bit value which then can reference to any memory pointer, numeric value, or alike. My understanding of "stack" versus "heap" is that unless I use new/delete in order to specifically allocate memory for a variable's storage space that it will be allocated upon the stack, correct? If so, the following three declarations would...
by: Chris Mabee | last post by:
Hello all, and Merry Christmas, I'm having a problem understanding an example of an array based implementation of a stack in a textbook of mine. The code in question is written below. The syntax is directly as in the book, except for where I added the comments at the lines I wanted to refer to or to skip sections of code. template <class Element_Type> class Stack {
by: Thomas Ibbotson | last post by:
I've been going through a tutorial on C++ and I've come across what I regard as some strange behaviour. As part of the tutorial on classes a simple stack is implemented with functions push() and pop(). I test this stack using: stack a_stack; // Create an instance of stack // Push some data onto the stack a_stack.push(1); a_stack.push(2);
by: Sushil | last post by:
Hi gurus I was reading FAQ "alloca cannot be written portably, and is difficult to implement on machines without a conventional stack." I understand that the standard does not mandate "heap" or "stack" I'm curious to know the implemenations which dont have stack or heap.
by: Dave Bailey | last post by:
I have an application installed on a web server. When forst intalled it worked fine. The administrator rebooted the server and then when accessing the app the folowing error appears: CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired. I am using DPAPI(Machine Store) to encrypt a connection string. The decryption code is as follows: private string GetConnectionString() { DataProtector dp...
by: Teis Draiby | last post by:
I'm looking for some information (books, articles, tutorials) on how to implement a multiple undo/redo framework. I'm a beginner in this so I prefer information specifically targeting C# with code samples. Is seems that the 'Command Pattern' is the way to achieve it (?). If you know any good resources I would be very happy to know! Thank you very much!, Teis
by: Phil Sandler | last post by:
Hello all, Thanks in advance for any help with this. I am trying to get sample code to run from Michael Russell's excellent article on removing whitespace: http://www.codeproject.com/aspnet/WhitespaceFilter.asp I have also tried his updated version, which can be found (in a zip file) here:
by: javuchi | last post by:
I just want to share some code with you, and have some comments and improvements if you want. This header file allocates and add and delete items of any kind of data from a very fast array: #include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__
by: svkers | last post by:
Hi all, I have a question concerning the implementation of an interface between two layers of a network stack (see extract of the subsequent stack). Furthermore I am thankful for some hints how to implement frames in C. Stack and Frames: ... ++++++++++++++ + Layer n+1 + ++++++++++++++ + Layer n +
by: tabassumpatil | last post by:
Please send the c code for: 1.STACK OPERATIONS : Transfer the names stored in stack s1 to stack s2 and print the contents of stack s2. 2.QUEUE OPERATIONS : Write a program to implement DOUBLE ENDED QUEUE operations a) Use names as data to perform all operations like enqueue,dequeue,print,etc. b)Use students records as data to perform the same operations. 3.FILE OPERATIONS: write c program to implement following FILE operations:...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.