×
Home Discussions Write at Opengenus IQ
×
  • #7daysOfCode
  • C Interview questions
  • Linux πŸ’½
  • πŸ”Š Data Structures
  • Graph Algorithms
  • Dynamic Programming πŸ’‘
  • Greedy Algo πŸ“”
  • Algo Book 🧠
  • String Algo 🧬
  • Join our Internship πŸŽ“
  • Home

permutation

A collection of 2 posts

Algorithms

Finding the Lexicographical Next Permutation in O(N) time complexity

In Lexicographical Permutation Algorithm we will find the immediate next smallest Integer number or sequence permutation. Finding all permutations take O(N!) time complexity but we present an efficient algorithm which can solve this in O(N) time complexity

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Algorithms

Heap’s algorithm for generating permutations

Heap's Algorithm is used to generate all the possible permutation of n-decimals of a number. It generates each permutation from the previous one by interchanging a single pair of elements; the other nβˆ’2 elements are not disturbed. For N numbers, it takes O(N!) time complexity

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
×

Visit our discussion forum to ask any question and join our community

View Forum
OpenGenus IQ © 2021 All rights reserved β„’ [email: team@opengenus.org]
Top Posts LinkedIn Twitter