Question

Answer the following MCqs about Data Structures in Java: 1.If you were to build you own...

Answer the following MCqs about Data Structures in Java:

1.If you were to build you own online video player, but you want your costumer to be able to start playing the video before its %100 downloaded. You will probably need to download the video as frames, what data structure would be the best choice to store these frames before you start displaying them to your consumer?

a) Stack b)Queue

2. Consier the following code:

  Stack stack = new Stack();
 stack.push(new Integer(11));
 stack.push(new Integer(13));
 stack.push(new Integer(2));
 stack.peek();
 System.out.println(stack);
 stack.pop();
   System.out.println(stack);

What should the first System.out.println output:

a)[11,13]

b)[11,13,2]

c)[13,2]

4.If you were to build you own online video player, but you want your costumer to be able to start playing the video before its %100 downloaded. You will probably need to download the video as frames, what data structure would be the best choice to store these frames before you start displaying them to your consumer?

a)Stack b)Queue

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. b) Queue

2.

 Stack stack = new Stack();
 stack.push(new Integer(11));
 stack.push(new Integer(13));
 stack.push(new Integer(2));
 stack.peek();  // 2
 System.out.println(stack); // [11, 13, 2]
 stack.pop();
   System.out.println(stack);  // [11, 13]

4.

b)Queue

Add a comment
Know the answer?
Add Answer to:
Answer the following MCqs about Data Structures in Java: 1.If you were to build you own...
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
  • Computer Science 182 Data Structures and Program Design Programming Project #3 – Link List Card Games...

    Computer Science 182 Data Structures and Program Design Programming Project #3 – Link List Card Games One of the nice things about Java is it is very easy to do fun things with graphics. The start code provided here will display a deck of cards on the screen and shuffle them. Your mission, is to start with this code and build a card game. Blackjack, poker solitaire, what ever your heart desires. Blackjack is the easiest. Obviously any program you...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

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