SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 3 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 28 Nov 2017 My Price 8.00

Provide efficient solutions for the questions asked.

HOMEWORK 2

CS512 - Data Structures

 

 

 

Deadline: This assignment is due by the class on Friday, June 16 2016 at 5:30 pm.

 

Provide efficient solutions for the questions asked.

 

Don't forget to write your names on your stapled answer sheets.

 

There are five questions. Each question is of 5 points.

 

 

 

 

1. Using stack data structure please determine if the following postfix expression is valid or not. Explain each step showing the current state of the stack and the top pointer.

 

4 1 + 3 * 7 1 3 * 4 + -

 

If the above expression is valid please evaluate using a stack. Show the current state of the stack and the top pointer at all steps.

 

 

 

2. A palindrome is a word which reads the same backward or forward. Examples: civic, radar, malayalam. For the sake of this question, assume that all words given to you have odd number of letters in them. Every letter in your word is of the same case - upper or lower case.

 

a)  How would you use stacks to determine if a given word is a palindrome or not?

 

b)  Check if your approach works for the following two words: racecar, dalda. For both of these words show the stack (and the top pointer) at each step of your algorithm.

 

c)  What is the Big-O complexity of your approach?

 

 

 

3. Using stacks please evaluate the following postfix expression:

 

7 4 + 2 * 8 3 * 4 - +

 

    Show the state of the stack and the top pointer at all steps.

 

 

 

4. Suppose I give you a list of seven numbers. E.g.: 77, 3, 34, 6, 7, 8, 1. You need to reverse the list of given numbers. For instance, the reverse of above list will be: 1, 8, 7, 6, 34, 3, 77.

 

How will you do this using Stacks? Explain your answer showing the operations you will use and the state of the stack at each step.

 

What is the Big-O complexity of your approach?

 

 

 

5. What do you understand by LIFO? Briefly explain the five operations of a stack.

Answers

(5)
Status NEW Posted 28 Nov 2017 07:11 AM My Price 8.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)