Skip to content

Pramo92/DSA-Stack-Tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA-Stack-Tutorials

  1. Write a program to reverse a user given number using Stack operations.

Example:12345 → 54321

  1. Given a sentence contains multiple words and write a program to reverse the entire sentence word by word using Stack operations and display the top element of the stack.

Input: Data Structures and Algorithms

Output: Algorithms and Structures Data

  1. Write a program to check whether the given string is palindrome using stackoperations.

Ex: palindrome – Mom, Madam

  1. Write entire java program to convert a given integer to octal and hexadecimal.

  2. Write a program to validate the order of opening and closing parentheses in a mathematical expression using stack operations. The program should determine whether the parentheses are balanced or not.

a) Write a program to keep track of the highest value included in a given stack. Theelement with the highest value may be at the top of the stack, but as soon as another element is added, the maximum value is determined by the remaining elements.

Suppose the elements are pushed on to the stack in the order {1, 4, 16, 7, 45}

Step 1: Push 1, Current Maximum: 1

Step 2: Push 4, Current Maximum: 4

Step 3: Push 16, Current Maximum: 16

Step 4: Push 7, Current Maximum: 16

Step 5: Push 45, Current Maximum: 45

b) Change the above program to determine the maximum value using the remaining elements when an element from the stack is removed

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages