Skip to content

Feature shuffle array #6026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Oct 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
  • Loading branch information
rashi07dashore committed Oct 26, 2024
commit 27bc1fbe2c7bf3664dbfdbccd924bb698d42950e
27 changes: 2 additions & 25 deletions src/test/java/com/thealgorithms/misc/ShuffleArrayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@

import org.junit.jupiter.api.Test;

/**
* Unit tests for the ShuffleArray class.
*
* @author Rashi Dashore (https://github.com/rashi07dashore)
*/
class ShuffleArrayTest {

/**
* Test for basic shuffling.
*/
public class ShuffleArrayTest {

@Test
void testShuffleBasic() {
int[] arr = {1, 2, 3, 4, 5};
Expand All @@ -26,9 +18,6 @@ void testShuffleBasic() {
assertNotEquals(originalArr, arr);
}

/**
* Test for an edge case with a single element.
*/
@Test
void testShuffleSingleElement() {
int[] arr = {1};
Expand All @@ -39,9 +28,6 @@ void testShuffleSingleElement() {
assertArrayEquals(originalArr, arr);
}

/**
* Test for an edge case with two elements.
*/
@Test
void testShuffleTwoElements() {
int[] arr = {1, 2};
Expand All @@ -55,9 +41,6 @@ void testShuffleTwoElements() {
assertTrue(arr[1] == 1 || arr[1] == 2);
}

/**
* Test for an empty array.
*/
@Test
void testShuffleEmptyArray() {
int[] arr = {};
Expand All @@ -68,9 +51,6 @@ void testShuffleEmptyArray() {
assertArrayEquals(originalArr, arr);
}

/**
* Test for large array.
*/
@Test
void testShuffleLargeArray() {
int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
Expand All @@ -81,9 +61,6 @@ void testShuffleLargeArray() {
assertNotEquals(originalArr, arr);
}

/**
* Test to ensure all elements are present after shuffle.
*/
@Test
void testShuffleRetainsElements() {
int[] arr = {1, 2, 3, 4, 5};
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy