Can i have an example on the selection sort and bubble sort how to count the time complixity and how to count the operations and what is the traveling sales man problem
The Selection sort algorithm is available in pseudocde from Wikipedia, as is the Bubble Sort. The time complexity is computed by the number of times it takes the algorithm to run through until it gets the right answer.
The Traveling Salesman problem is a classic problem in computer science that interrelates the algorithm's execution time with figuring out the answer to the question.
To wit:
The problem is: given a number of cities and the costs of travelling from any city to any other city, what is the least-cost round-trip route that visits each city exactly once and then returns to the starting city?
If I try to use an algorithm to bruteforce the best route, it'll take a really long time on any route bigger than the simplest route. That's where Big(O) comes in, it shows me how each algorithm I'd choose would affect how long it'd take me to get the answer.
I posted this answer based off of the comments you left for other answers. For what it's worth, Big-O notation is exactly what you want, it's the indicator of how long your algorithm will take to execute.