Skip to content

Mansijain850/Algorithms-Searching

Repository files navigation

Algorithms-Searching

Searching: searching can be imagined as finding your "black" "eminem" tshirt from a cupboard full of tshirts. Formally we can say that it is the process of finding an item with "specified" properties in a collection of items.

So, why do we need searching? Data we store is very large and hence very messy. To retrive data it must be organised. Sorting helps maintaining elements ordered, sorted and hence making our conquest easier. Various types of searching are present but we will first start with:-

1.LINEAR SEARCH -sorted: where the elements are stored in a messy haphazard way (just like most of your rooms are!). Now you will start from one end (until you get your tshirt) till the other end of the room, searching every corner for that tshirt and when you will find it you will wear it and leave your room. Same way you will start your search from the starting element till the end and whenever you find that element you just simply return that you have found the element.

-unsorted:Here the elements are stored in a neat sorted way (just like my room!) and to search the element we do not need to scan complete array if the value that we are searching to becomes less than the next value we can simple conclude that element cannot be found and hence return "element not found."

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published