Open
Description
Objective
Develop a comprehensive set of programs to demonstrate advanced array manipulation techniques, focusing on problem-solving and algorithmic thinking.
Assignment Tasks
Task 1: Dynamic Array Management (25 points)
Create a program that:
- Implements a dynamic array management system with the following functions:
- Create an array with user-defined size
- Insert element at a specific position
- Delete element from a specific position
- Search for an element and return its index
- Display current array contents
- Calculate and display array statistics (mean, median, mode)
Requirements:
- Use dynamic memory allocation
- Handle memory errors gracefully
- Implement input validation
- Support integer arrays
Task 2: Matrix Operations (30 points)
Develop a comprehensive matrix manipulation program:
- Support operations on two 2D arrays (matrices)
- Implement functions to:
- Input matrix elements
- Display matrix
- Matrix addition
- Matrix multiplication
- Find transpose of a matrix
- Calculate matrix determinant (for 3x3 matrices)
- Check if matrix is symmetric
Constraints:
- Support matrices up to 10x10
- Handle different matrix sizes
- Implement error checking for matrix compatibility
Task 3: Advanced Sorting and Searching (25 points)
Create a comprehensive sorting and searching application:
-
Implement multiple sorting algorithms:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
-
Searching techniques:
- Linear Search
- Binary Search (for sorted arrays)
- Search and count occurrences of an element
Requirements:
- Compare and display time complexity for each algorithm
- Allow user to choose sorting method
- Generate random array for testing
- Implement performance tracking
Task 4: Advanced Array Manipulation (20 points)
Develop a program to perform complex array operations:
- Find and remove duplicates from an array
- Rotate array left or right by specified positions
- Merge two sorted arrays
- Split array into even and odd number arrays
- Find missing numbers in a sequence
- Implement circular array operations
Challenges:
- Minimize time and space complexity
- Handle edge cases
- Provide detailed statistical analysis
Task 5: String Array Processing (25 points)
Create a string array management system:
- Input multiple strings (up to 50 characters each)
- Implement functions to:
- Sort strings alphabetically
- Remove duplicate strings
- Search string by partial match
- Count vowels and consonants in each string
- Encrypt/decrypt strings using simple algorithms
- Reverse each string
- Compare strings lexicographically
Additional Requirements:
- Support case-insensitive operations
- Handle memory efficiently
- Implement robust input validation
Bonus Challenge (20 points)
Implement an advanced array challenge:
- Create a program that:
- Generates Pascal's triangle
- Calculates prime numbers in a given range
- Implements matrix spiral traversal
- Finds longest increasing subsequence
- Performs complex mathematical operations on arrays
Evaluation Criteria
- Correctness of implementation (40 points)
- Code efficiency and optimization (20 points)
- Error handling and input validation (15 points)
- Code readability and commenting (15 points)
- Creative problem-solving approach (10 points)
Submission Guidelines
- Submit individual .c files for each task
- Include a README explaining implementation details
- Provide sample input/output
- Comment your code thoroughly
- Demonstrate understanding of array concepts
Learning Objectives
- Master array manipulation techniques
- Understand dynamic memory allocation
- Develop algorithmic thinking
- Improve problem-solving skills
- Learn efficient coding practices
Recommended Approach
- Break down complex problems into smaller functions
- Use modular programming
- Implement error checking
- Test each function individually
- Optimize for time and space complexity
Additional Resources
- Recommended reading on array algorithms
- Online algorithm visualization tools
- Time complexity analysis resources
Hints and Tips
- Use pointers effectively
- Manage memory carefully
- Implement robust input validation
- Consider edge cases
- Use standard library functions judiciously
- Focus on code readability
Skills Developed
- Dynamic memory management
- Algorithm implementation
- Performance optimization
- Error handling
- Advanced C programming concepts