Example of telephone directory, Data Structure & Algorithms

Assignment Help:

A telephone directory having n = 10 records and Name field as key. Let us assume that the names are stored in array 'm' i.e. m(0) to m(9) and the search has to be made for name "X", i.e. element = "X".

Telephone Directory

Name                              id.

AA                         25161234

BB                          22752345

CC                       23405678

DD                    22361111

EE                        24782202

FF                           26254444

GG                       26150880

HH                                25513653

II                        26252794

KK                        26257149

 

The above algorithm will search for element = "GG" and will stop at 6th index of array and the needed id is "26150880", which is stored at position 7 i.e. 6+1.


Related Discussions:- Example of telephone directory

Determine the precondition of a binary search, Determine the precondition o...

Determine the precondition of a binary search For instance, precondition of a binary search is that array searched is sorted however checking this precondition is so expensive

Graphs, floyd warshall algorithm

floyd warshall algorithm

Program segment for quick sort, Illustrates the program segment for Quick s...

Illustrates the program segment for Quick sort. It uses recursion. Program 1: Quick Sort Quicksort(A,m,n) int A[ ],m,n { int i, j, k; if m { i=m; j=n+1; k

Convert graph into tree, How can we convert a graph into a tree ? Do we hav...

How can we convert a graph into a tree ? Do we have any standardized algorithm for doing this?

Depth first search, DEPTH FIRST SEARCH (DFS) The approach adopted into ...

DEPTH FIRST SEARCH (DFS) The approach adopted into depth first search is to search deeper whenever possible. This algorithm frequently searches deeper through visiting unvisite

Draw a b-tree., Q. Draw a B-tree of order 3 for the sequence of keys writte...

Q. Draw a B-tree of order 3 for the sequence of keys written below: 2, 4, 9, 8, 7, 6, 3, 1, 5, 10

Threaded binary tree, i need the full concept of it... please can anyone pr...

i need the full concept of it... please can anyone provide

Dynamic programming., Count Scorecards(30 points) In a tournament, N playe...

Count Scorecards(30 points) In a tournament, N players play against each other exactly once. Each game results in either of the player winning. There are no ties. You have given a

Java code and algorythem, Suppose that you want to develop a program that a...

Suppose that you want to develop a program that accepts a postfix expression and asks values for variables in the expression. Then you need to calculate the answer for the expressi

#, write an algorithm to search a particular node in linked list which retu...

write an algorithm to search a particular node in linked list which returns " FOUND" or "NOT FOUND" as outcome.

Write Your Message!

Captcha
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