Test Case Generation | Set 5 (Generating random Sorted Arrays and Palindromes)
Generating Random Sorted Arrays
We store the random array elements in an array and then sort it and print it.
Generating Random Palindromes
- The test case generation plan generates odd as well as even length palindromes.
- The test case generation plan uses one of the most under-rated data structure- Deque
- Since a palindrome is read the same from left as well as right so we simply put the same random characters on both the left side (done using push_front()) and the right side (done using push_back())
This article is contributed by Rachit Belwariar. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
References : –
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.