Reverse the entire string, then reverse the letters of each individual word.
After the first pass the string will be
s1 = "Z Y X si eman yM"
and after the second pass it will be
s1 = "Z Y X is name My"
More Related Contents:
- Ukkonen’s suffix tree algorithm in plain English
- How to create the most compact mapping n → isprime(n) up to a limit N?
- Implement a queue in which push_rear(), pop_front() and get_min() are all constant time operations
- Hash table runtime complexity (insert, search and delete)
- Find kth smallest element in a binary search tree in Optimum way
- How do you validate a binary search tree?
- design a stack such that getMinimum( ) should be O(1)
- Best algorithm to test if a linked list has a cycle
- Array remove duplicate elements
- What string similarity algorithms are there?
- How Do I Choose Between a Hash Table and a Trie (Prefix Tree)?
- What is the fastest way to find the closest point to a given point?
- Algorithm to find multiple string matches
- Find the first un-repeated character in a string
- insert, delete, max in O(1)
- In Order Successor in Binary Search Tree
- Algorithm for autocomplete?
- Hashing a Tree Structure
- graph – Dijkstra for The Single-Source Longest Path
- What is the advantage to using Bloom filters?
- Why does Dijkstra’s algorithm use decrease-key?
- Word comparison algorithm
- Search a sorted 2D matrix [duplicate]
- Why increase pointer by two while finding loop in linked list, why not 3,4,5?
- Finding groups of similar strings in a large set of strings
- Why use binary search if there’s ternary search?
- Why are hash table expansions usually done by doubling the size?
- What are probabilistic data structures?
- How to find the number of different shortest paths between two vertices, in directed graph and with linear-time?
- Given a set of intervals, find the interval which has the maximum number of intersections