What is the best search algorithm for random data

Asked By 0 points N/A Posted on -
qa-featured

Hey guys… Im looking for an alternative search algorithm apart from the sequential search that can also search random data, no indexing. I have a huge database of clients to search from and im currently developing an application in python programming language that can quickly search the database for a match

SHARE
Answered By 0 points N/A #193046

What is the best search algorithm for random data

qa-featured

There are many types of algorithm that we can use to implement/execute the output of any collective data or commonly known as information.

1. Recursive Algorithm. It is one of the best way to search data from your database. This algorithm will call the functions or algorithm multiple times until you get the desired output. You can perform tasks without sorting data.

2. Bubble-Sort Algorithm. The most simple sort algorithm that organizes data will first search for any value, replace the first searched value if the value is greater than or equal.

Example declarations: in VB 6.0

You will need a FORM and a Command Button

 

Option Explicit

Dim A(20) As Integer

Dim num, i, j, k, arr, temp As Integer

 

Private Sub Command1_Click()

arr = 0

Print "Your array contains: "

For k = 0 To num – 1

    Print "A"; "("; arr; "):"; A(k)

    arr = arr + 1

Next k

End Sub

Private Sub Form_Load()

num = InputBox("Intialize the size of your array:")

For i = 0 To num – 1

    A(i) = InputBox("Enter your array: ")

Next i

 

'this will sort your array in ascending order

For i = 0 To num – 1

    For j = i + 1 To num – 1

        If A(i) > A(j) Then

            temp = A(i)

            A(i) = A(j)

            A(j) = temp

        End If

    Next j

Next i

 

End Sub

“This will sort array in ascending order.” You can also get idea from this simple declaration at A1VBCODE.com.

Related Questions