hello everybody i need some body help me to make code for a linked list and arrays build stack and queue such that when i push an element in the stack i can dequeue it first from the queue and when i enqueue an elemet in the queue , it will be the last element can be popped from the stack. by c++
pls any body help ass son as posible........ .....
thanks all
2 2860
The STL contains pre-built container classes for stacks, queues, etc.
If you want help building your own, you should probably post the code you have so far, or describe where you are having difficulty.
hello everybody i need some body help me to make code for a linked list and arrays build stack and queue such that when i push an element in the stack i can dequeue it first from the queue and when i enqueue an elemet in the queue , it will be the last element can be popped from the stack. by c++
pls any body help ass son as posible........ .....
thanks all
i will list the concepts what u have to learn for achieving ur requirements..
1)structure in C++.
2)Linked List in C++.
3)Stack(LIFO)
4)Queue(FIFO)
5)Adding a node to the beginning of the linked list
6)Adding a node to the end of the linked list
7)Deleting a node from the beginning of a linked list
7)Deleting a node from the end of the linked list
if u learn the above concepts..then u can do coding without any problem..if u face any problem during coding then come here with ur code then everyone will be ready to sort it out...
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jeffrey Silverman |
last post by:
Hi, all. I have a linked list. I need an algorithm to create a tree
structure from that list.
Basically, I want to turn this:
$list = array(
array( 'id' => 'A', 'parent_id' => null, 'value' => 'aaa')
, array( 'id' => 'B', 'parent_id' => 'A', 'value' => 'bbb')
, array( 'id' => 'C', 'parent_id' => 'B', 'value' => 'ccc')
, array( 'id' => 'D', 'parent_id' => 'A', 'value' => 'ddd')
|
by: darth |
last post by:
Does anyone have heap sorting with queue(doublely linked list) in C?
I have heap sort with array but with queue, it's somewhat hard.
|
by: AMRaymo |
last post by:
Can someone guide me in the right direction on how to enqueue and
dequeue/pop and push within a linked list? I've figured out the basic
idea, but getting the other options in it seems ot be a problem.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct info {
char name;
|
by: Xarky |
last post by:
Hi,
I am writing a linked list in the following way.
struct list
{
struct list *next;
char *mybuff;
};
|
by: Henk |
last post by:
Hi,
I am new to the c-programming language and at the moment I am
struggling with the following:
I want to read a file using fread() and then put it in to memory. I
want to use a (singel) linked list to continousely (dynamically) free
up more memory when needed and put the buffers with the data of the
file on a sort of stack.
The problem is that i have no idea how to do this.
| |
by: oeillet |
last post by:
hi every one iwant ahelp in this assignment(program ,code in c++)
its as follows;
aprogram that contain all operation that performed by linked list ; also contain amethod that calculate how many elements are there in the linked list & print them..... then at the same program write aclass called queue that perform two operation <en equeue& de equeue> ..finally write aclass called stack that perform operation<empty,push,pup>.
note:
this must...
|
by: Dongsheng Ruan |
last post by:
with a cell class like this:
#!/usr/bin/python
import sys
class Cell:
def __init__( self, data, next=None ):
self.data = data
|
by: Joerg Schoen |
last post by:
Hi folks!
Everyone knows how to sort arrays (e. g. quicksort, heapsort etc.)
For linked lists, mergesort is the typical choice.
While I was looking for a optimized implementation of mergesort for
linked lists, I couldn't find one. I read something about Mcilroy's
"Optimistic Merge Sort" and studied some implementation, but they
were for arrays. Does anybody know if Mcilroys optimization is applicable to
truly linked lists at all?
|
by: yaarnick |
last post by:
Create a linked list data structure library to hold strings. Then library should support the following linked list operations.
Create() – Creates the linked list
Insert() – Insert a string into the linked list
Delete() – Deletes a string from the linked list
Search() – Search for a string and return 1 if found otherwise return 0.
isEmpty() – Returns 1 if the list is empty and 0 otherwise.
Display() – Display all the strings in the list.
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |