5003CEM Advanced Algorithms Assignment

Assignment Help Other Subject
Reference no: EM132930413 , Length: word count:3000

5003CEM Advanced Algorithms - Coventry University

Code Submission and Report
Learning Outcome 1: Design and implement algorithms and data structures for novel problems
Learning Outcome 2: Specify and implement methods to estimate solutions to intractable problems
Learning Outcome 3: Design and implement a basic concurrent application

TASKS:

STD 1
Binary search
Implement binary search in Python or C++. Please find the pseudocode for this implementation below.

BINARY_SEARCH(sequence, value)
middle ← GET_MIDDLE(sequence)
WHILE value != sequence[middle]
IF length(sequence) > 1
IF value > sequence[middle]
sequence ← sequence[middle .. length(sequence)]
ELSE
sequence ← sequence[0 .. middle]
ELSE
IF value != sequence[middle]
RETURN FALSE
middle ← GET_MIDDLE(sequence)
RETURN TRUE

STD 2
Double Linked List
Implement the insertion of an element in a double linked list in Python. You can find pseudocode in lecture Week 5 from Slide 78 for deleting an element in a double linked list. You should insert "Wed" in the implementation of the double linked list.

Note that the code shown here is also on Aula with the assessment: doubleLinkedList-withoutSolution.py

class Node:
def __init__(self, dataval = None):
self.data = dataval
self.next = None
self.prev = None

class SLinkedList:
def __init__(self):
self.head = None
self.tail = None

def listprint(self):
printval = self.head
while printval is not None:
print (printval.data)
printval = printval.next

def AtBeginning(self,newdata):
NewNode = Node(newdata)

def AtEnd(self, newNode):
if self.head is None:
self.head = newNode
return
last = self.head
while(last.next):
last = last.next
last.nexts = newNode

list = SLinkedList()
list.head = Node("Mon")

e2 = Node("Tue")
e3 = Node("Thur")
e4 = Node("Fri")
e5 = Node("Sat")
e6 = Node("Sun")
list.head.next = e2
e2.next = e3
e3.next = e4
e3.prev = e2
e4.next = e5
e4.prev = e3
e5.next = e6
e5.prev = e4
e6.prev = e5
list.AtEnd(e5)

list.listprint()

STD 3
Quicksort with middle value as pivot
Implement quicksort with the middle value as a pivot in either Python or C++.

ADV 1
BST traversal: pre-order, in-order, post-order.
For this task, which is to be completed in Python, use the code BST_BASIC-insert+pretty-print.py, on Moodle with this assessment specification.
Implement pre-order, in-order, and post-order traversal using three different methods.
If your instance of the BinaryTree class is called bst, call the methods using:
bst.pre_order()
bst.in_order()
bst.post_order()
Each call should return its result as a list.

ADV 2
Concurrent Powers
The following code returns the results of the integers in a list of values to the power of input po. Rewrite this as concurrent code in Python, using concurrent.futures. In the concurrent version, it is not necessary for results to be printed in the same sequence as is output by the code below.

values = [2,3,4,5,6,7,8,9,10]

def powers(val,po):
return val ** po

def non_concurrent_powers(po):
for val in values:
res = powers(val,po)
print('%s to the power of %s is %s' % (val,po,res), '\n')

This code is in the file non_concurrent_powers.py, on Moodle with this assessment.

Attachment:- Advanced Algorithms.rar

Reference no: EM132930413

Questions Cloud

Conflict management : Search online for different resources that you could use or suggest to someone else who is experiencing different types of conflict.
Determine the amount of factory overhead : During the month of February 2021, job A-1 incurred direct labor of 1,600 hours. Determine the amount of factory overhead
What is the company WACC : The target capital structure consists of 30% debt and 70% common equity. What is the company's WACC if all the equity used is from retained earnings
What is the face value of a note discounted : What is the face value of a note discounted at 12% for 90 days if the borrower receives $814.80 as proceeds
5003CEM Advanced Algorithms Assignment : 5003CEM Advanced Algorithms Assignment Help and Solution, Coventry University - Assessment Writing Service
What is leadership succession : What is leadership succession?. Provide five articles to back up your explanation
Conflict management strategy : Describe the strategy you think is best for conflict management.
Effective telework in organizations : literature review surveys books, scholarly articles, and any other sources relevant to a particular issue, area of research,
Record the disposals : Record the disposals. Traded in an old vehicle for a new vehicle, receiving a $10,000 trade-in allowance and paying $36,000 cash.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd