Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

1/19/2021 Form2-Alg-FINAL

Form2-Alg-FINAL

Questions (Sorular)

1. Merge Sort is a stable sort. 2. Quick sort is an in-place sort. 3. The best
performance of binary tree sort is when data is in sorted or reverse sorted order.
4. All operations on a binary search tree take O(h) running time where h is the
height of the tree. 5. The recursive algorithm for merge sort uses combine and
conquer technique. Which of the up sentences are false?

1, 2, 3, 4,5

2, 3, 4,5

Not within the listed option(s)

2,3

3, 4,5

2,4,5

1,3,4

4,5

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 1/19
1/19/2021 Form2-Alg-FINAL

Suppose that: binary search tree node structure in the application as follows:
rootTree is the root node of the application. Some parts of the code below for
searching information are missing. First node name is start and last node name is
last. Match the missing parts with the options. a if(wanted <= rootTree-
>infotmation!=wanted) b while(rootTree != NULL && rootTree-
>information!=wanted){ c rootTree= rootTree->left; d rootTree= rootTree->right;

1-b;2-a;3-c;4-d;

1-a;2-b;3-c;4-d;

1-d;2-c;3-a;4-b;

NONE

Other:

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 2/19
1/19/2021 Form2-Alg-FINAL

What is or are the heights of D ?

NONE

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 3/19
1/19/2021 Form2-Alg-FINAL

Fill the below code with correct order?

return v.data; v.data=yi->data; g->data=data; yi=g;

g->data=data; yi=g; return v.data; v.data=yi->data;

v.data=yi->data; g->data=data; yi=g; return v.data;

NONE

g->data=data; yi=g; data=yi->data; return v.data;

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 4/19
1/19/2021 Form2-Alg-FINAL

What tasks or task do the algorithm below algorithm in relation to the elements
in the two sided linked lists?

Search

NONE

Changing

Deletion

Sort

Adding

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 5/19
1/19/2021 Form2-Alg-FINAL

It is wanted to add a node to the one-way linked list. The name of the node to be
added is ‘yildiz’. Some parts of the code below for adding node are missing. First
node name is start and last node name is last. Match the missing parts with the
options and write them in a specific format. a last->mark=NULL; b last=first; c
last->mark=ki; d fist->arka=NULL;

1-a;2-b;3-c;4-d;

1-c;2-a;3-b;4-d;

1-d;2-c;3-b;4-a;

1-b;2-c;3-a;4-d

NONE

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 6/19
1/19/2021 Form2-Alg-FINAL

How may passes will be required to sort this data using radix sort. 12, 345, 121,
564, 2342, 231, 7, 989, 3231.

NONE

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 7/19
1/19/2021 Form2-Alg-FINAL

a treeRoot b treeRoot->right c treeRoot->left d treeRoot->information Match the


empty spaces in the above code with the appropriate code snippets.

NONE

a,b,c,d

b,c,d,a

c,d,a,b

d,a,b,c

c,d,b,a

d,c,b,a

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 8/19
1/19/2021 Form2-Alg-FINAL

A circular linked list can be used for

Stack

Queue

Neither Stack or Queue

NONE

Both Stack & Queue

Assume a linked list has been created and the start pointer is referring the first
node of that linked list. Select the following code that can add a new node that
addresses hold by temp pointer, at beginning of that linked list. Temp is adding
node and start is: (temp is adding node, start is showing first node and node has
link and information parts.)

NONE

temp->link=start; start=temp;

start=temp; temp->link=start;

temp=start; temp=start->link;

start=temp->link; temp=start;

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 9/19
1/19/2021 Form2-Alg-FINAL

Find the Big O Analysis of Algorithms value of this function.

O(logn)

O(n^2)

O(n^2 logn)

O(n^3)

NONE

Other:

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 10/19
1/19/2021 Form2-Alg-FINAL

Which of the up sentences are false?

2,3

None of listed options

1,3,5

4,5
https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 11/19
1/19/2021 Form2-Alg-FINAL

ALL

1. In asymptotic analysis, the exact running time is calculated. 2. For analysing an


algorithm, we study how the running time of the algorithm increases with the
increase in input size. 3. Growth rate of n is more than growth rate of logn. 4.
While computing the O notation, base of the logarithm is not important. 5. Nodes
of a linked list are stored in contiguous memory locations. 6. We can use a self-
referential structure to represent a node of a linked list. Which of the up
sentences are false?

1,3,4

4,6

1,5

NONE

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 12/19
1/19/2021 Form2-Alg-FINAL

1. In Bubble sort, adjacent elements are compared and exchanged if out of order.
2. An unstable sort maintains the relative order of duplicate keys. 3. An in-place
sort requires only a negligible amount of storage for sorting. 4. Selection sort,
there are more swaps in a single pass. 5. If n elements have to be sorted using
selection sort, then total number of passes required is n-1 6. If input data is in
sorted order then time complexity of bubble sort is O(n). Which of the up
sentences are false?

None of lhe listed options

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 13/19
1/19/2021 Form2-Alg-FINAL

Pseudo-code of the algorithm deleting / removing node from the binary search
tree.Write the correct order them with no separator.

cdefgab

NONE

gecbadf

cebfadg

abcdefg
https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 14/19
1/19/2021 Form2-Alg-FINAL

1. Traversing a binary search tree in preorder gives us the nodes in ascending


order. 2. In a binary search tree, last node in the leftmost path starting from root
is the node with the smallest key. 3. In a binary search tree, last node in the
rightmost path starting from root is the node with the largest key. 4. After
deleting node 33 from this binary search tree, node 44 will become left child of
node 57. (Showed figure) 5. Insertion sort proceeds by placing the first element
of unsorted part into the sorted part. Which of the up sentences are false?

ALL

1,3,5

NONE

1,3

3,4
https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 15/19
1/19/2021 Form2-Alg-FINAL

What should be there in the place of question mark to insert a new node after
the node pointed to by p in a doubly linked list. (temp is adding node, next is
pointer part of node showing next and prev is a pointer part of node showing
previous.)

NONE

p->prev

p->next->prev

Which of these statements will delete a node form the end of a doubly linked list,
if temp points to the last node.

NONE

temp->next->prev=NULL;

temp->prev->next=NULL;

temp->prev=NULL;

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 16/19
1/19/2021 Form2-Alg-FINAL

Below code is for the insertion sort code. Fill the below code with the correct
order?

insert=D[i]; D[k+1]=D[k]; D[k+1]=insert;

D[k+1]=insert; insert=D[i]; D[k+1]=D[k];

D[k+1]=D[k]; insert=D[i]; D[k+1]=insert;

NONE

Other:

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 17/19
1/19/2021 Form2-Alg-FINAL

Which tree or trees are not balanced?

y l

NONE

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 18/19
1/19/2021 Form2-Alg-FINAL

Page 3 of 3

Back Submit

Never submit passwords through Google Forms.

This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy

Forms

https://docs.google.com/forms/d/e/1FAIpQLSeuNKvI6y2H6_sQCOaI4-f3VHOtA8XrCUdusGT_ynFEGLq-nw/formResponse 19/19

You might also like