An open API service indexing awesome lists of open source software.

https://github.com/harismuneer/mapping-3d-array-to-1d-array

🌌 Demonstrating the concept of representing/flattening a 3D array as a 1D array by solving a real life problem
https://github.com/harismuneer/mapping-3d-array-to-1d-array

1d-array 3d-to-1d 3d-to-1d-array array-dimensions-mapping array-flatten array-flattening array-index array-indexing array-indicing array-manipulation array-manipulations flat-arrays flatten-3d-array-to-1d-array flatten-array flattening-3d-array flattening-3darray mapping-algorithms mapping-array

Last synced: 3 months ago
JSON representation

🌌 Demonstrating the concept of representing/flattening a 3D array as a 1D array by solving a real life problem

Awesome Lists containing this project

README

        

# 🌌 Mapping 3D Array to 1D Array

views
[![Open Source Love svg1](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](#)
[![GitHub Forks](https://img.shields.io/github/forks/harismuneer/Mapping-3D-Array-to-1D-Array.svg?style=social&label=Fork&maxAge=2592000)](https://www.github.com/harismuneer/Mapping-3D-Array-to-1D-Array/fork)
[![GitHub Issues](https://img.shields.io/github/issues/harismuneer/Mapping-3D-Array-to-1D-Array.svg?style=flat&label=Issues&maxAge=2592000)](https://www.github.com/harismuneer/Mapping-3D-Array-to-1D-Array/issues)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat&label=Contributions&colorA=red&colorB=black )](#)

## Mapping Formula
If you have a 3D array **Original[HEIGHT, WIDTH, DEPTH]** then you could turn it into **Flat[HEIGHT * WIDTH * DEPTH]** 1D array by

```Flat[x + HEIGHT * (y + WIDTH * z)] = Original[x, y, z], assuming Original[HEIGHT,WIDTH,DEPTH]```

To study more about this, refer to following links:
* [Row and Column Major Order](https://en.wikipedia.org/wiki/Row-_and_column-major_order)
* [Flatten a 3D array to 1D array](https://stackoverflow.com/questions/7367770/how-to-flatten-or-index-3d-array-in-1d-array)

## Problem
In order to better understand the array mapping, following real life problem is solved:

![problem](../master/images/p.png)

## Functions Implemented
![problem](../master/images/f.png)


## Author
You can get in touch with me on my LinkedIn Profile: [![LinkedIn Link](https://img.shields.io/badge/Connect-harismuneer-blue.svg?logo=linkedin&longCache=true&style=social&label=Follow)](https://www.linkedin.com/in/harismuneer)

You can also follow my GitHub Profile to stay updated about my latest projects: [![GitHub Follow](https://img.shields.io/badge/Connect-harismuneer-blue.svg?logo=Github&longCache=true&style=social&label=Follow)](https://github.com/harismuneer)

If you liked the repo then kindly support it by giving it a star ⭐ and share in your circles so more people can benefit from the effort.

## Contributions Welcome
[![GitHub Issues](https://img.shields.io/github/issues/harismuneer/Mapping-3D-Array-to-1D-Array.svg?style=flat&label=Issues&maxAge=2592000)](https://www.github.com/harismuneer/Mapping-3D-Array-to-1D-Array/issues)

If you find any bugs, have suggestions, or face issues:

- Open an Issue in the Issues Tab to discuss them.
- Submit a Pull Request to propose fixes or improvements.
- Review Pull Requests from other contributors to help maintain the project's quality and progress.

This project thrives on community collaboration! Members are encouraged to take the initiative, support one another, and actively engage in all aspects of the project. Whether it’s debugging, fixing issues, or brainstorming new ideas, your contributions are what keep this project moving forward.

With modern AI tools like ChatGPT, solving challenges and contributing effectively is easier than ever. Let’s work together to make this project the best it can be! πŸš€

## License
[![MIT](https://img.shields.io/cocoapods/l/AFNetworking.svg?style=style&label=License&maxAge=2592000)](../master/LICENSE)

Copyright (c) 2018-present, harismuneer


Waving hand
Hey there, I'm Haris Muneer πŸ‘¨πŸ»β€πŸ’»

Total Github Stars
Total Github Followers


- πŸ› οΈ Product Builder: Agile Product Manager with 5+ years of hands-on experience delivering SaaS solutions across sales, recruiting, AI, social media, and public sector domains. Background in Computer Science, with a proven track record of scaling products from inception to $XXM+ ARR, launching 3 top-ranking tools on Product Hunt, and developing solutions adopted by 250+ B2B clients in 40+ countries.

- 🌟 Open Source Advocate: Passionate about making technology accessible, I’ve developed and open-sourced several software projects for web, mobile, desktop, and AI on my GitHub profile. These projects have been used by thousands of learners worldwide to enhance their skills and knowledge.

- πŸ“« How to Reach Me: To learn more about my skills and work, visit my LinkedIn profile. For collaboration or inquiries, feel free to reach out via email.


🀝 Follow my journey