• Sonuç bulunamadı

Karadeniz Technical University Department of Computer Engineering

N/A
N/A
Protected

Academic year: 2021

Share "Karadeniz Technical University Department of Computer Engineering "

Copied!
2
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

Karadeniz Technical University Department of Computer Engineering

Lecturer Omer CAKIR

COM 205 Data Structures

Final Exam, 06.01.2014, 15:00, D-1, D-8 Time : 90 Minutes

NUMBER : ……… NAME : ………...

Rules to be Obeyed During the Exam SIGNATURE : ………...

EXAM GRADE

[...] ...

1. Cell phones are not allowed to be used as a calculator or a watch. They must be switched off and placed in the pocket.

2. Brief information about the exam will be given at the begining, then no one is not allowed to ask a question during the exam.

3. Do not to forget to sign this paper after writing your number and name.

void right(int i, int p, int n,int k) {

cout << i << endl;

if(n == k) return;

else right(i+p, p, n+1, k);

}

void down(int i, int p, int n, int k) {

if(n == k) cout << i << endl;

else right(i, p, 1, k);

if(i == 1) return;

else down(i/2, p/2, 1, k*2);

}

void main() {

down(8, 16, 1, 1);

}

Output

1. What is the output of the program above? (25P)

7 6 5 4 3 2 1

2. Insert elements above into a Heap. (25P)

(2)

2 3 4 5 6 7 1

3. Insert elements above into a Splay Tree. (25P)

1 2 3 4 5 6 7 8 9

4. Insert elements above into a 2-3-4 Tree. (25P)

Referanslar

Benzer Belgeler

 Students will be asked to report their observations and results within the scope of the application to the test report immediately given to them at the end of

Students have to obey Engineering Faculty Exam Execution Instructions.. Assume that the numbers above are inserted into a

Assume that numbers of each choice are inserted into a seperate binary tree.. In this case one tree is different from

Complete removeOrdered() function above that removes an element from a doubly

insertOrdered() that insert elements with ascending order into a doubly linked list gives an error because line sequence of one or more code block written in bold is changed.. Write

Write the sentences from dictionary.txt to relative.txt like above using Hash() function above.. Use linear probing as a collision

We construct a family of partition identities which contain the following identi- ties: Rogers-Ramanujan-Gordon identities, Bressoud’s even moduli generalization of them, and

Given 6 pictures of different people, and 3 descriptions of 3 of these pictures, the student will be able to identify which description belongs to which picture and be able