Friday 31 July 2020

Group B 12[b] Write a python program to store names and mobile numbers of your friends in sorted order on names. Search your friend from list using Fibonacci search. Insert friend if not present in phonebook.


Very good explanation of Fibbonacci Search

Problem Statement:

b) Write a python program to store names and mobile numbers of your friends in sorted order on names. Search your friend from list using Fibonacci search. Insert friend if not present in phone book.



Source Code:







Output:

Author: Nitin Mohan Shivale
Phone Book Application implementation using...
Fibbonacci Search Method:
The element inside phone book are as follows:
['amol', 1234567892]

['bavesh', 2132654522]

['chetan', 9923511212]

['dheeraj', 9823463224]

['eravati', 8530770714]

Total elements present in phonebook  are: 5


Enter friend name u want to search:Bhavana


bhavana
bhavana  is not present in phonebook


Record bhavana is now inserted in phonebook....


Enter mobile number of your friend:9923511212


['bhavana', 9923511212]


[['amol', 1234567892], ['bavesh', 2132654522], ['chetan', 9923511212], ['dheeraj', 9823463224], ['eravati', 8530770714], ['bhavana', 9923511212]]


but for Binary and Fibonnaci search record must be in sorted order in phonebook


****** after Sorting the data in phonebook...******
[['amol', 1234567892], ['bavesh', 2132654522], ['bhavana', 9923511212], ['chetan', 9923511212], ['dheeraj', 9823463224], ['eravati', 8530770714]]


Record  bhavana  added successfully in phone book....
>











data structures and algorithms Web Developer

No comments:

Post a Comment