Find Jobs
Hire Freelancers

Algorithms

$10-30 USD

В роботі
Опублікований about 7 years ago

$10-30 USD

Оплачується при отриманні
1) Consider a Sorted Doubly-Linked List, which means that keys are kept always sorted and stored in a doubly linked list: a) Implement an operation SD-LIST-INSERT(L,k) that inserts an integer key k into list L. What is the running time Θ(.) of your implementation? b) Implement an operation SD-LIST-DELETE(L,k) that removes a key k from the list. What is the running time Θ(.) of your implementation? c) Implement operations SD-LIST-SUCCESSOR(L,k) and SD-LIST-PREDECESSOR(L,k) that returns the successor and predecessor of a key k, respectively. What is the running time Θ(.) of your implementation? d) Implement an operation SD-LIST-SEARCH(L,k) that searches for a key k in list L and returns its node position (e.g., 1 if first, 2 if second, etc). What is the running time Θ(.) of your implementation? e) Implement an operation SD-LIST-REVERSE(L) that reverses the order of the keys in place (i.e., Θ(n) space complexity). What is the running time Θ(.) of your implementation? 2) Consider inserting 15 distinct letters into a Hash Table of size m=9 using open-addressing with auxiliary function h'(k)=position_in_alphabet(k). For example, h'(A)=1, h'(B)=2, h'(C)=2, etc. a) Choose 15 unique letters to be your keys. Then, illustrate the result of inserting these keys in the order defined in a) using: b) Linear probing; c) Quadratic probing with c1=1 and c2=3; d) Double hashing with h1(k)=h'(k) and h2(k)=1+(h'(k) mod (m-1)) Show your calculations. 3) Consider an application that frequently inserts data into a BST and even more frequently performs searches on these data. Because of the high demand for search operations, this application simply can't afford the worst-case searches of a BST (i.e., Θ(n)). To this end, it frequently has to check the height of the BST so it can rebalance it if necessary. It is your chance to show your value to the company and improve their application. Your first job is: a) To implement an operation called TREE-HEIGHT(x) that (efficiently) calculates the height h of a node x in the BST of Chapter 12 (i.e., h=#levels-1); b) Next, answer what the time and space complexity of your implementation is; After a few tests though, you realize that your time complexity is still too high for the application. Therefore, you decide to approach the problem from a different perspective. You decide to add an extra field to each node in the BST that stores the height of that node in the tree. That should allow you to look up the tree height in constant time. So your second job is: c) To make all necessary changes to TREE-INSERT(T,z) and TREE-DELETE(T,z) to accommodate an extra field for the height of each node; d) To implement another operation called TREE-HEIGHT-LOOKUP(x) that retrieves the height h of the node x in constant time; Now, your third and final job is: e) To evaluate and discuss your 2 approaches by answering: "Which of the 2 applications is more efficient? The one with TREE-HEIGHT(x) or the one with TREE-HEIGHT-LOOKUP(x)?" Explain. *Tip: Note that by allowing constant time height look-ups, you added some overhead in computing 2 other operations.
ID проекту: 13588233

Про проект

9 пропозицій(-ї)
Дистанційний проект
Активність 7 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
Доручений:
Аватарка користувача
boss ...................................................................................................................................................................................................................................................................................................
$35 USD за 1 день
5,0 (82 відгуки(-ів))
5,8
5,8
9 фрілансерів(-и) готові виконати цю роботу у середньому за $70 USD
Аватарка користувача
hi Hope you're doing well. Lets get started on that. I am expert programmer and i am sure i would be right fit for this job. Thanks :)
$77 USD за 3 дні(-в)
4,7 (15 відгуки(-ів))
4,8
4,8
Аватарка користувача
Hi, I am professional freelancer and student of theoretic informatics, I have several experience with algorithms design, your project description is pretty long but is really simple. Hire me and you will get a TOP quality product! Regards, Bc. Martin Risa
$90 USD за 1 день
5,0 (2 відгуки(-ів))
1,0
1,0
Аватарка користувача
A proposal has not yet been provided
$66 USD за 5 дні(-в)
4,0 (1 відгук)
0,0
0,0
Аватарка користувача
A proposal has not yet been provided
$15 USD за 2 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0

Про клієнта

Прапор UNITED STATES
Rancho Cordova, United States
5,0
1
Спосіб оплати верифіковано
На сайті з квіт. 1, 2017

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.