Database Application Development [on hold]

203
January 16, 2018, at 5:53 PM

Hi, i am student, just started coding on 2017 june. i have came across this qns and am not able to do. can anybody provide some help? i am currently using visual studio. thank you

  1. Conversion Using Recursion (8%)

You will need to use some of your Recursion knowledge you have learnt in LOMA( logic and math) in this question.

a. Modify the Binary Search such that it uses recursion in it. (Hint: You need to have a function that takes in the list, the number to look for, the starting point and the ending point and returns the position of the number if found.)

Use the following code to test your program.

b. Modify the following Insertion Sort code such that it uses recursion and achieves the same output as its other counterpart.

Run the list at the end of the code to ensure that your program works.

Hint : Keep the inner “while” loop as it is. You can do recursion for the outer for-loop. Your function should take in a list and the size of the list as parameters.

  1. Secondhand Bookstore (19%)

Uncle Joe started the Greenville Secondhand Bookstore in 2000. As years passed, the number of books in his store increased significantly. He can no longer keep track of their location in his store. Knowing you are from School of informatics & IT, he has approached you to develop a program (in Python) that could help him to keep track of the books.

Your program should fulfil the following requirement:

a. AddBookToFront(newBook) : This method will create a new Node with the new Book object as its data value and then add the newly created node to the front of the linked list.

b. AddBookAtPosition(newBook, n) : This method will create a new Node with the new Book object as its data value and then add the newly created node at position n of the linked list. Assume that the first node of the linked list has a position number of 0 and the second node has a position number of 1 and so on.

c. RemoveBookAtPosition(n): This method will remove the node at position n in the linked list. Assume that the first node of the linked list has a position number of 0 and the second node has a position number of 1 and so on.

d. DisplayBook(): This method will traverse the linked list from its first node to its last node and print the data value (i.e., the id, bookName and authorName of the Book object) of each node.

e. SortByAuthorName(): This method will sort the linked list by the book author’s name in ascending order.

Notes: • You are allowed to make changes to the LinkedList and Node classes as you deemed fit. • You are not allowed to use List for this question. • You are not allowed to use any existing Python libraries to do sorting. • Your solution should use objects and classes effectively. • You are to write your own script to test your solutions.

Rent Charter Buses Company
READ ALSO
fetch data between min and max price from mongodb using node js

fetch data between min and max price from mongodb using node js

I am trying to fetch data between min and max price from property model

199
how to create duplicate list in trello clone using mongoose node.js [on hold]

how to create duplicate list in trello clone using mongoose node.js [on hold]

The hierarchy of List: List -> Items -> (attachements,comments,labels)

237
How to prepare APN for production

How to prepare APN for production

Im trying to deploy my app with notifications but it's giving me the biggest headache in the worldAll other questions ive seen with regards to this seem outdated

243