Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pleeassee hhhellpp with this data structure QUESTION 24 Given a list below. Sort this list using the selection sort. List out or show the steps

pleeassee hhhellpp with this "data structure" image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
QUESTION 24 Given a list below. Sort this list using the selection sort. List out or show the steps to get this list sorted in increasing order. 20 7 10 4 5 6 For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac), B I g Paragraph Arial 14px iii E A QUESTION 25 e. Given the following segment of the program, a. Stack color = new Stack(5); b. Queue shape = new Queue(5); c. String x, y; d. S.push("blue"); S.push("orange"); f. Q.enqueue("green"); Q.enqueue("red"); h. x=S.peekTop(); i. Q.enqueue(x); j. System.out.println("Popped: "+S.pop(); k. y=Q.dequeue(); 1. System.out.println("Removed: "+y); S.push(y); Q.enqueue(y); Q.enqueue(brown); p. System.out.println("Front from Q:" +Q.peekFront(); 9. System.out.println("Top from S:" +S.peek Top(); System.out.println("Stack size: "+S.size(); S. System.out.println("Queue size: "+Q.size(); m. n. 0. T. Click Save and Submit to save and submit. Click Save All Answers to save all answers. j. k. 1. m. n. System.out.println("Popped: "+S.pop(); y=Q.dequeue(); System.out.println("Removed: "+y); S.push(y); Q.enqueue(y); Q.enqueue(brown); System.out.println("Front from Q:" +Q.peekFront(); System.out.println("Top from S:" +S.peekTop(); System.out.println("Stack size: "+S.size()); System.out.println("Queue size: "+Q.size(); 0. p. 9. 1. S. After the code is executed, a) Show the output from the above program. (3.0 marks) b) List all the contents of the stack and queue. (1.5 marks) For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac). BI Paragraph Arial V 14px iii Click Save and Submit to save and submit. Click Save All Answers to save all answers. QUESTION 19 The bubble sort algorithm alternates between copying and comparing. O True False QUESTION 20 if two elements in the priority queue have the same priority. FIFO principle will be used. O True False QUESTION 21 The contents of a queue can be wrapped around (circular), while stack cannot. O True False QUESTION 11 How many comparisons does bubble sort make on an array:10. 20.30, 40, 807 O 001) on) O on O O(log n) 42 QUESTION 12 - A queue that is implemented using an array of size MAX_SIZE will get full when Rear-MAX_SIZE - 1 Rear-.1 Front - rear + 1 Rear-front QUESTION 13 Alinear list of elements in which insertion and deletion can be done only from one end is known as a O Queue Stack O Array Priority Queue Given a queue with size 5. What would be the value of the second element to be removed from the queue? Index 0 1 2 3 4 "A 'B' "C B Stack Underflow QUESTION 9 are the two main measures for algorithm efficiency. Time and space Data and space O Capacity and memory Processor and memory QUESTION 10 and respectively in a queue, the initial values of front pointer frare pointer should be O and 1 O and -1 -1 and o 1 and o QUESTION 4 Given the following code segment, what is printed? intt 1 x -12,4,6,8,10); System.out.println(x [2] ++): 06 7 03 23 QUESTION 5 Given the following class Student class Student { String name; double spa; Student(String n, double c) { name = n; gpa - c; Which of the following statements is syntactically CORRECT if written in application class? OstdArray[0] new Student("rawan". 3.4); System.out.println(StdArray[1]); String Student - new String(5): O Student stdArray() - new Student("rawan", 3.4)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions