Found 546 Articles for Algorithms

Linear Search

Arushi
Updated on 15-Jun-2020 14:54:10

3K+ Views

Linear searching techniques are the simplest technique. In this technique, the items are searched one by one. This procedure is also applicable for unsorted data set. Linear search is also known as sequential search. It is named as linear because its time complexity is of the order of n O(n).The complexity of Linear Search TechniqueTime Complexity: O(n)Space Complexity: O(1)Input and OutputInput: A list of data: 20 4 89 75 10 23 45 69 the search key 10 Output: Item found at location: 4AlgorithmlinearSearch(array, size, key)Input − An sorted array, size of the array and the search keyOutput − location of the ... Read More

Jump Search

Arushi
Updated on 15-Jun-2020 14:00:54

5K+ Views

Jump search technique also works for ordered lists. It creates a block and tries to find the element in that block. If the item is not in the block, it shifts the entire block. The block size is based on the size of the list. If the size of the list is n then block size will be √n. After finding a correct block it finds the item using a linear search technique. The jump search lies between linear search and binary search according to its performance.The complexity of Jump Search TechniqueTime Complexity: O(√n)Space Complexity: O(1)Input and OutputInput: A sorted ... Read More

Interpolation Search

Rishi Raj
Updated on 15-Jun-2020 14:05:21

2K+ Views

For the binary search technique, the lists are divided into equal parts. For the interpolation searching technique, the procedure will try to locate the exact position using interpolation formula. After finding the estimated location, it can separate the list using that location. As it tries to find exact location every time, so the searching time reduces. This technique can find items easily if the items are uniformly distributed.The complexity of Interpolation Search TechniqueTime Complexity: O(log2(log2 n)) for the average case, and O(n) for the worst case (when items are distributed exponentially)Space Complexity: O(1)Input and OutputInput: A sorted list of data: ... Read More

Exponential Search

Paul Richard
Updated on 15-Jun-2020 14:10:42

3K+ Views

Exponential search is also known as doubling or galloping search. This mechanism is used to find the range where the search key may present. If L and U are the upper and lower bound of the list, then L and U both are the power of 2. For the last section, the U is the last position of the list. For that reason, it is known as exponential.After finding the specific range, it uses the binary search technique to find the exact location of the search key.The complexity of Exponential Search TechniqueTime Complexity: O(1) for the best case. O(log2 i) ... Read More

Binary Search

Moumita
Updated on 15-Jun-2020 14:14:41

4K+ Views

When the list is sorted we can use the binary search technique to find items on the list. In this procedure, the entire list is divided into two sub-lists. If the item is found in the middle position, it returns the location, otherwise jumps to either left or right sub-list and do the same process again until finding the item or exceed the range.The complexity of Binary Search TechniqueTime Complexity: O(1) for the best case. O(log2 n) for average or worst case.Space Complexity: O(1) Input and OutputInput:  A sorted list of data: 12 25 48 52 67 79 88 93 The ... Read More

Operating system time slicing in round robin scheduling

Arnab Chakraborty
Updated on 20-Jun-2020 09:50:34

176 Views

process Burst time A 4 B 1 C 8 D 1time slice=10 unitA B C D A C C C 0 2 3 5 6 8 10 12 14So A will complete 8 cycles.

Advertisements