This project implements a complex randomization and analysis algorithm in C. It combines Alternating Generation, Stochastic Placement, and Sliding Window Analysis.
The process is divided into three phases:
Generates a stream of
- Negative
$\to$ Positive$\to$ Negative$\to$ ...
Unlike standard arrays where elements are placed linearly (
- Effectively shuffles the data during insertion.
Finds the sequence of
-
Formula: Maximize
$\sum_{j=i}^{i+(N/2)} Array[j]$
- Compile the code:
gcc main.c -o optimizer
- Run the executable:
./optimizer
- Enter the array size (
$N$ ).
This repository demonstrates randomized data structures and optimization algorithms in C.