Final_DSA - Question 1 Marks 1 After two passes of a sort...

Info icon This preview shows pages 1–6. Sign up to view the full content.

Question 1 Marks: 1 After two passes of a sort algorithm, the following array: 47 3 21 32 56 92 has been rearranged as shown below: 3 21 47 32 56 92 Which sorting algorithm is being used? Choose one answer. a. all of them. b. insertion sort. c. selection sort. d. bubble sort. Question 2 Marks: 1 Which of the following Sorting algorithms use Divide and Conquer strategy? Choose one answer. Question 3 Marks: 1 Suppose the frequencies of use of characters is given by: A [10%], B [20%], C [70%] What is the average length of the Huffman codes? Choose one answer. Question 4 Marks: 1 What type of the hash functions that can be used in an English – Vietnamese dictionary?
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Choose one answer. b . Extraction Question 5 Marks: 1 A recursive method may be eliminated by using ………… ..... Choose one answer. a. Iteration statements b. Stacks c. All of the others. Question 6 Marks: 1 Choose one answer. Question 7 Marks: 1 How many recursive calls to calculate the 5 th Fibonacci number? Choose one answer. Question 8
Image of page 2
Marks: 1 Consider the following algorithm on binary search tree in Java: The above algorithm will _______ Choose one answer. Question 9 Marks: 1 A graph can be used to show relationships. From the following list of people belonging to the same club (vertices) and their friendships (edges): Peope = {George, Jim, Jean, Frank, Fred, John, Susan} Friendship = {(George, Jean), (Frank, Fred), (George, John), (Jim, Fred), (Jim, Frank), (Jim, Susan), (Susan, Frank)} Find all friends of friends of Jean. Choose one answer. a. Jim and George b. John and Jean c. Nobody d. Fred, Frank and Susan Question 10 Marks: 1 Given a graph below and colors numbered 1, 2, 3, ... are assigned to vertices with the sequential coloring algorithm that orders vertices by alphabetical order (i.e. the vertex labeled A comes first, then the vertex B,...)
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

What is the color of the vertex E? Choose one answer. Question 11 Marks: 1 Suppose we are considering a doubly linked list which is not empty. Select the most correct java code snippet that inserts new node with value x at the head of the list (the new node will be the first node in the list). Choose one answer. Node q = new Node(x); q.prev=null; q.next = head; head.prev = q; Node q = new Node(x); q.prev=null; q.next = head; head.prev = q;
Image of page 4
head = q; Node q = new Node(x); q.prev=null; q.next = head; head = q; Node q = new Node(x); q.next = head; head.prev = q; head = q;
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 6
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '14

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern