I have tried to create my own vector header file. In this the programmer can create the vector and use its methods to play with the vector.
Steps to use MyVector.h :-
- Clone the respository or download the zip file and extract it.
- include the headerfile "MyVector.h" in program.
- Create Vector Objects and use it's methods.
Available Vector Methods are :-
// Vector Methods //
- push_in()
- pop_out()
- flush_vector()
- show_elements()
- sort()
- is_element_exits()
- get_length()
- implement_binary_search()
- get_element()
- get_sum()
- get_product()
- get_max()
- get_min()
// Operators that can be used with vector objects //
- [] // used to get elements by specifying their index
-
-
// used to Concantenate two Vectors
-
- += // used to Concantenate two Vectors
- < // used to Compare two Vectors
-
// used to Compare two Vectors
- == // used to Compare two Vectors
- != // used to Compare two Vectors
- <= // used to Compare two Vectors
-
= // used to Compare two Vectors
Class MyIterator :- This class helps to iterate over a vector.
Available Iterator methods :-
// Iterator Methods //
- restart_iterator()
- change_vector()
// Operators that can be used with iterator objects //
- = // used to assign value to th iterator
- == // used to Compare iterator objects
- != // used to Compare iterator objects
- ++ // used to increment value of iterator object ( Pre-Increment )
- ++ // used to increment value of iterator object ( Post-Increment )
- += // used to increment value of iterator object by the given value
- -- // used to deccrement value of iterator object ( Pre-decrement )
- -- // used to Decrement value of iterator object ( Post-Decrement )
- -= // used to Decrement value of iterator object by the given value
-
-
// used to get the value from the iterator
-