Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 79ff075

Browse filesBrowse files
committed
readme
1 parent 0afd922 commit 79ff075
Copy full SHA for 79ff075

File tree

Expand file treeCollapse file tree

3 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+3
-3
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Abstract Data Types in C
2-
This is a modern C library containing implementations designed to provide fast and efficient data structure operations for a wide range of applications. All ADT's have been implemented using [void pointers](https://www.geeksforgeeks.org/void-pointer-c-cpp/) to make them generic, allowing the same code to handle different data types. The library contains the following ADT's:
2+
This is a modern C library containing implementations designed to provide fast and efficient data structure operations for a wide range of applications. All ADT's have been implemented using [void pointers](https://www.geeksforgeeks.org/void-pointer-c-cpp/) to make them generic, allowing the same code to handle different data types (eg integers, strings, structs etc). The library contains the following ADT's:
33

44
* [Vector](https://github.com/pavlosdais/Abstract-Data-Types/tree/main/modules/Vector#readme)
55
* [Stack](https://github.com/pavlosdais/Abstract-Data-Types/tree/main/modules/Stack#readme)

‎modules/Vector/README.md

Copy file name to clipboardExpand all lines: modules/Vector/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
A [vector](https://en.wikipedia.org/wiki/Dynamic_array) (or dynamic array) is a data structure that allows elements to be added or removed. Vectors overcome the limit of static arrays, which have a fixed capacity that needs to be specified at allocation. This limitation is overcomed by growing in size, in this implementation by doubling.
1+
[Vector](https://en.wikipedia.org/wiki/Dynamic_array) (or dynamic array) is a data structure that allows elements to be added or removed. Vectors overcome the limit of static arrays, which have a fixed capacity that needs to be specified at allocation. This limitation is overcomed by growing in size, in this implementation by doubling.
22

33
# Performance
44
<img align="right" width=330 alt="vector picture" src="https://www.interviewcake.com/images/svgs/dynamic_arrays__capacity_size_end_index.svg?bust=210">

‎modules/Vector/vector.c

Copy file name to clipboardExpand all lines: modules/Vector/vector.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void vector_push_back(const Vector vector, const Pointer data)
9090
if (vector->size == vector->capacity)
9191
{
9292
vector->capacity *= 2;
93-
vector->arr = realloc(vector->arr, vector->capacity * sizeof(*(vector->arr)));
93+
vector->arr = realloc(vector->arr, vector->capacity * sizeof(*(vector->arr)));
9494
}
9595

9696
// insert data

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.