0% found this document useful (0 votes)
19 views1 page

Cse

The document describes algorithms and data structures including FizzBuzz, reversing a string, determining if a string is a palindrome, checking if two strings are anagrams, calculating a factorial, binary search, merge sort, implementing a linked list, stack, and queue, finding a missing number in an array, rotating an array, finding two elements that sum to a target, finding the maximum sum subarray, and compressing a string.

Uploaded by

01 ABITHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Cse

The document describes algorithms and data structures including FizzBuzz, reversing a string, determining if a string is a palindrome, checking if two strings are anagrams, calculating a factorial, binary search, merge sort, implementing a linked list, stack, and queue, finding a missing number in an array, rotating an array, finding two elements that sum to a target, finding the maximum sum subarray, and compressing a string.

Uploaded by

01 ABITHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

FizzBuzz: Write a program that prints the numbers from 1 to 100.

But for multiples


of three print "Fizz" instead of the number and for the multiples of five print
"Buzz". For numbers which are multiples of both three and five, print "FizzBuzz".

Reverse a String: Write a function to reverse a string.

Palindrome: Write a function to determine if a string is a palindrome.

Anagram: Write a function to determine if two strings are anagrams of each other.

Factorial: Write a function to calculate the factorial of a given number.

Binary Search: Implement the binary search algorithm to find an element in a sorted
array.

Merge Sort: Implement the merge sort algorithm to sort an array.

Linked List: Implement a singly linked list and its basic operations like
insertion, deletion, and traversal.

Stack: Implement a stack data structure and its basic operations like push, pop,
and peek.

Queue: Implement a queue data structure and its basic operations like enqueue and
dequeue.

Find Missing Number: Given an array containing n distinct numbers taken from 0, 1,
2, ..., n, find the one that is missing from the array.

Rotate Array: Rotate an array of n elements to the right by k steps.

Two Sum: Given an array of integers, return indices of the two numbers such that
they add up to a specific target.

Maximum Subarray: Find the contiguous subarray within an array, which has the
largest sum.

String Compression: Implement a method to perform basic string compression using


the counts of repeated characters. For example, the string "aabcccccaaa" would
become "a2b1c5a3". If the compressed string would not become smaller than the
original string, your method should return the original string

You might also like