Skip to content

Commit

Permalink
Merge pull request #5 from vaStarra/patch-1
Browse files Browse the repository at this point in the history
Update zvector.h file to fix a few typos. No code changes.
  • Loading branch information
pzaino authored Dec 30, 2023
2 parents 54134e7 + 3f4f8af commit 9f64d43
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/h/zvector
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool vect_is_empty(const_vector const v);
zvect_index vect_size(const_vector const v);

/*
* vect_size returns the maximum size (the max number of)
* vect_max_size returns the maximum size (the max number of)
* slots in the vector storage.
*/
zvect_index vect_max_size(const_vector const v);
Expand Down Expand Up @@ -307,7 +307,7 @@ void vect_add_front(vector const v, const void *item);
/*
* vect_get returns an item from the specified vector
*
* vect_get(v) will return the ast element in
* vect_get(v) will return the last element in
* the v vector (but will not remove
* the element as it happens in
* vect_pop(v)).
Expand Down Expand Up @@ -491,13 +491,12 @@ void vect_qsort(vector const v, int (*compare_func)(const void *, const void*),


/*
* vect_bsearch is a function that allows to perform
* a binary search over the vector we pass to it to
* find the item "key" using the comparison function
* "f1".
* vect_bsearch is a function that performs a binary
* search over the vector we pass to it, to find the
* item "key" using the comparison function "f1".
*
* The specific algorithm used to implement vect_bsearch
* if my own re-implementation of the Adaptive Binary
* is my own re-implementation of the Adaptive Binary
* Search algorithm (from Igor van den Hoven) which has
* some improvements over the original one (look at the
* sources for more details).
Expand All @@ -511,12 +510,12 @@ void vect_qsort(vector const v, int (*compare_func)(const void *, const void*),
bool vect_bsearch(vector const v, const void *key, int (*f1)(const void *, const void *), zvect_index *item_index);

/*
* vect_lsearch is a function that allows to perform
* traditional linear search over an ordered or not
* vect_lsearch is a function that performs a
* traditional linear search over an ordered or non
* ordered vector. If the vector size is a multiple of
* 2 the fuction optimize the traditional loop using
* 2, the fuction optimizes the traditional loop using
* 4 unrolled consecutive searches, while if the vector
* size is odd it uses traditional loop (for now).
* size is odd, it uses traditional loop (for now).
*
* It finds the item "key" using the comparison function
* "f1", which has to be provided by the user as a pointer
Expand Down

0 comments on commit 9f64d43

Please sign in to comment.