Question

CS 20A: batar Santa Monica College Spring 2019 Namen Multiple Choice: Circle the answer that fits best and write out your let
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1) Stack input

E

D

C

B

A

AFTER POPPED

A

QUEUE INSERTION: E D C B

QUEUE POPPED: E D

QUEUE CONTAINS : C B

1) c. C Since we can see next item will be C

2) e. 14

Solution:

(7,2)

7%2 = 1 != 2

therefore else condition run recurse(9,5)

Again:

9%5 = 1!=2

therefore else condition run recurse(14,4)

14%4 = 2==2 return a=14;

therefore Ans 14

3.c log N

Since,, insertion complexity is O(h) where h is height of tree and h = log N

/* Please Upvote (thank you in advance) */

Add a comment
Know the answer?
Add Answer to:
CS 20A: batar Santa Monica College Spring 2019 Namen Multiple Choice: Circle the answer that fits...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Santa Monica College CS 20A: Data Structures with C++ Spring 2019 Name: True/False: Circle one Assignment...

    Santa Monica College CS 20A: Data Structures with C++ Spring 2019 Name: True/False: Circle one Assignment 1 ID: 1. True / False 2. True / False 3. True / False 4. True / False 5. True / False 6. True / False 7. True / False 8. True / False 9. True / False 10. True / False Variable and functions identifiers can only begin with alphabet and digit. Compile time array sizes can be non-constant variables. Compile time array...

  • Hello, I have some errors in my C++ code when I try to debug it. I...

    Hello, I have some errors in my C++ code when I try to debug it. I tried to follow the requirements stated below: Code: // Linked.h #ifndef INTLINKEDQUEUE #define INTLINKEDQUEUE #include <iostream> usingnamespace std; class IntLinkedQueue { private: struct Node { int data; Node *next; }; Node *front; // -> first item Node *rear; // -> last item Node *p; // traversal position Node *pp ; // previous position int size; // number of elements in the queue public: IntLinkedQueue();...

  • Need help in the below question. Answer in java Start with the tree.java program (Listing 8.1)...

    Need help in the below question. Answer in java Start with the tree.java program (Listing 8.1) and modify it to create a binary tree from a string of letters (like A, B, and so on) entered by the user. Each letter will be displayed in its own node. Construct the tree so that all the nodes that contain letters are leaves. Parent nodes can contain some non-letter symbol like +. Make sure that every parent node has exactly two children....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT