Assign first element of array to smaller
smaller = array[0];
Start a loop with i = 1
and compare elements with smaller
. If smaller
is greater than any of array
element then replace it with that elment otherwise left it as it.
More Related Contents:
- Pattern Programmings
- the problem is from a algorithm problem I do recently,but I can't gain the right answer [duplicate]
- How to generate numbers upto 18 digits, sum of whose reciprocals is a whole number [closed]
- Why this C code makes infinite loop?
- Finding target sum of two numbers in array
- The most efficient way to implement an integer based power function pow(int, int)
- Efficient Algorithm for Bit Reversal (from MSB->LSB to LSB->MSB) in C
- What integer hash function are good that accepts an integer hash key?
- How to reverse a singly linked list using only two pointers?
- Unique random number generation in an integer array [duplicate]
- Calculating factorial of large numbers in C
- Combine Gyroscope and Accelerometer Data
- Building a logarithm function in C without using float type
- How can I simplify this working Binary Search code in C?
- Power by squaring for negative exponents
- Explain this snippet which finds the maximum of two integers without using if-else or any other comparison operator?
- C How to “draw” a Binary Tree to the console [closed]
- How to do unsigned saturating addition in C?
- Traverse Matrix in Diagonal strips
- How to find largest triangle in convex hull aside from brute force search
- C – How to implement Set data structure?
- Correctness of Sakamoto’s algorithm to find the day of week
- Rolling median in C – Turlach implementation
- Find maximum of three number in C without using conditional statement and ternary operator
- Algorithm to find all the exact divisors of a given integer
- Floating point linear interpolation
- Which is better way to calculate nCr
- Merging two sorted linked lists
- Variable Sized Arrays vs calloc in C
- A possible algorithm for determining whether two strings are anagrams of one another? [closed]