Coder Social home page Coder Social logo

dhawan9898 / dsa-c-library Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 21 KB

The DSA Standard Library for C: Open-source collection of efficient data structures & algorithms, fostering easy integration & reliable coding. Join us!

License: GNU General Public License v3.0

Makefile 4.57% C 95.43%

dsa-c-library's Introduction

dsa-c-library

The DSA Standard Library for C: Open-source collection of efficient data structures & algorithms, fostering easy integration & reliable coding. Join us!

Array Data Structure and Functions Implementation

Introduction

The array data structure is a collection of elements of the same type, stored in contiguous memory locations. Each element can be accessed using its index, starting from 0.

This repository provides a basic implementation of an array data structure in C, along with various functions to manipulate and work with arrays.

Functions

1. Array* create_array(size_t capacity)

Creates a new array with the specified capacity.

2. void destroy_array(Array* arr)

Frees the memory occupied by the array.

3. void resize_array(Array* arr, size_t new_capacity)

Resizes the array to the new specified capacity.

4. int get_element_at_index(const Array* arr, size_t index)

Returns the element at the specified index in the array.

5. void set_element_at_index(Array* arr, size_t index, int value)

Sets the value of the element at the specified index in the array.

6. bool is_empty(const Array* arr)

Checks if the array is empty.

7. size_t get_size(const Array* arr)

Returns the current size (number of elements) of the array.

8. size_t get_capacity(const Array* arr)

Returns the current capacity of the array.

9. bool insert_at_index(Array* arr, size_t index, int value)

Inserts an element with the given value at the specified index in the array.

10. bool delete_at_index(Array* arr, size_t index)

Deletes the element at the specified index in the array.

dsa-c-library's People

Contributors

dhawan9898 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.