In Bearbeitung

Algorithm Questions

Hello Freelancers,

I simply need help answering these Algorithm questions (Will also be attached):

#1. Catenable Stack

In this problem you will design a data structure that implements Stack ADT using singly-linked list instead of an array. In addition your stack will have the following additional operation:

public catenate(Stack s); // appends the contents of Stack s to the current stack

The new operation will have the following properties:

Let n = [url removed, login to view](), m = [url removed, login to view](). Then executing [url removed, login to view](s2) results in the following:

1. The new size of s1 is the sum of the size of s2 and the original size of s1, i.e., the following evaluates to true: [url removed, login to view]() == n+m

[url removed, login to view] n elements of s1 after the call [url removed, login to view](s2) are the same as the elements of s1 before the call. The bottom m elements of s1 after the call [url removed, login to view](s2) are the same as the elements of s2 before the call.

(a) The implementation described in the book, lecture notes and screencasts uses an array to implement Stack ADT. Can you implement catenate(Stack s) operation that runs in O(1) time for such implementation? If yes, write down the algorithm that achieves that and prove that it runs in O(1) time. If not, describe what goes wrong.

(b) Write down algorithms that implement the original Stack ADT using a singly-linked list instead of the array. That is, write down pseudocode for implementing each operation of Stack ADT: Stack(), push(Object o), pop(), size(), isEmpty(), top().

(c) Design an algorithm that implements catenate(Stack s) operation in O(1) time. Write down the algorithm and prove that it runs in O(1) time.

Thank you,

Daniel

Fähigkeiten: Algorithmen, Ingenieurwesen, Java, Mathematik, SQL

Mehr sehen: what's an algorithm, what's algorithm, what is the algorithm, what is stack data structure, what is linked list in data structure and algorithm, what is linked list in data structure, what is an algorithm, what is a linked list in data structure, what is algorithm in data structure, what is algorithm design, what is algorithm, what is a algorithm, what an algorithm, what algorithm, uses of stack in data structure, uses of stack data structure, uses of data structure, uses of algorithms, top java freelancers, top algorithms, top 10 algorithms, the algorithm is, the algorithm, stack of data structure, stack in data structure using java

Über den Arbeitgeber:
( 57 Bewertungen ) Sacramento, United States

Projekt-ID: #8350269

Vergeben an:

mmallis87

A proposal has not yet been provided

$10 USD in 0 Tagen
(1 Bewertung)
0.0

15 Freelancer bietetn im Durchschnitt $29 für diesen Job an

it2051229

Hi, I have read the requirements and I would like to do this project if given the opportunity. I am a computer science practitioner and having the "Java and Algorithms Certification Badge" in my profile gives me confid Mehr

$30 USD in 1 Tag
(714 Bewertungen)
7.1
urmate

HI Contact me for an efficient, perfect, well documented development of your project according to 100% accuracy and requirements, with dedicated support. Thanks

$25 USD in 1 Tag
(179 Bewertungen)
6.1
aazc5aazc

A proposal has not yet been provided

$55 USD in 1 Tag
(81 Bewertungen)
5.7
bencubeben

Hello, I am an Algorithm and Data Structures Expert and a competitive programmer and I have been using C++ and Java for all my projects and coding contests. I currently rank 379 out of almost 38000 competitive Mehr

$23 USD in 1 Tag
(22 Bewertungen)
4.0
Asad257

A proposal has not yet been provided

$25 USD in 1 Tag
(16 Bewertungen)
3.7
mcmbuvi

A proposal has not yet been provided

$20 USD in 1 Tag
(14 Bewertungen)
3.8
rizwanfpak

More than 7 years of industry experience in building applications. I am expert in algorithms, I have reviewed each part of your assignment and can do this job. Please review my profile for some of the sample work done Mehr

$70 USD in 2 Tagen
(5 Bewertungen)
3.5
mubashirabbas07

Hi,hope you are fine and doing great.i have seen detail and don't wanna waste your time to introduce [url removed, login to view] Expert and can do it [url removed, login to view] ready for this job right [url removed, login to view] give me this job. Thank you Rega Mehr

$17 USD in 1 Tag
(4 Bewertungen)
3.3
ajaykumar112792

i can do this job Sir. ----------------------------------------------------------------------------------------------------------------------------

$30 USD in 1 Tag
(0 Bewertungen)
0.0
rcdeo

I am a cse graduate.I have a very strong algorithmic and coding skills.I can give all implementation of your questions with proper comments in either of these languages : c/c++/java.

$25 USD in 1 Tag
(0 Bewertungen)
0.0
visionsoft7

Hello Sir, We have gone through the details you have provided and we have already worked on a similar project before and can deliver as u have mentioned and would be pleased to work on this with you to deliver the resu Mehr

$25 USD in 1 Tag
(0 Bewertungen)
0.0
sidpharate

A proposal has not yet been provided

$25 USD in 1 Tag
(0 Bewertungen)
0.0
joaquinhegi

La propuesta todavía no ha sido proveída

$30 USD in 3 Tagen
(0 Bewertungen)
0.0
attilapados

I think i already know the solution, if you pick me, i will write it down in a docx file with the pseudo codes you asked.

$25 USD in 0 Tagen
(0 Bewertungen)
0.0
jokertyagi

I am working as a Java developer and know how to develop a good program which can provide best time and space complexity.

$25 USD in 1 Tag
(0 Bewertungen)
0.0