# C++ Programming Code Examples

## C++ > Sorting Searching Code Examples

### Find the peak element of an array using Binary Search approach

C Code Locate Highest Lowest nr in Array -
C Program example Return the largest of the two passed numbers. Return smallest of the two passed numbers. Load some random values into the array. Print set of numbers.

Programs to Traverse the Tree Recursively -
C Coding, using recursion, performs traversal operation across the nodes in a tree. The tree we have used is the "Binary Search Tree". The user "Generates a Tree" by inserting integers.

Find the Largest Number Present in Array -
To find the largest element in an array in C++ programming, enter the array size, enter the array elements. Start finding for the Largest element in the array to "Display the Largest"

Find Twos Complement of Binary Number -
C program code to input binary number from user and find twos complement of the binary number. Twos complement of N-bit number is defined as the complement with respect to

C Program Implement BogoSort in Integer -
C Code to check if the "array is sorted" or not. Shuffle the "Array Elements" and check if the array is sorted or not & if not sorted calls the shuffle function to shuffle the array elements

Reference Operator Dereference Operator -
The pointer is a C++ programming data type whose value refers directly to (or "points to") another value stored elsewhere in computer memory using its address. Pointer examples

Generate Perfect Numbers in given Range -
C Program Code to print all Perfect Numbers between 1 to n. A Perfect number is a positive integer which is equal to the sum of its proper positive divisors. Input upper limit from user

C Find Volume and Surface Area of Sphere -
C Program calculates the volume and surface area of sphere. The formula used in this code Surface_area = 4 * Pi * r2, Volume = 4/3 * Pi * r3 where r is the radius of the sphere, Pi= 22/7