Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

lifeF/algorithoms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

11 Commits

Repository files navigation

Algorithms

Basic algorithms in Computer Science mathamatics (Discrete Mathamatics)

1. Longest Increasing Sub-sequence in an Array
In Longest Increasing Subsequence (LIS) problem, find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order

 Ex: Input : arr[] = {3, 10, 2, 1, 20,4,56,78,90}
 Output : Length of LIS = 6
 The longest increasing subsequence is 3, 10, 20, 56, 78, 90

Usage :Replace Your array with arr array and run it, static int [] arr ={3, 10, 2, 1, 20,4,56,78,90};

2. Pancake Problem

Suppose you are given a stack of n pancakes of different sizes. You want to sort the pancakes so that smaller pancakes are on top of larger pancakes. The only operation you can perform is a flip — insert a spatula under the top k pancakes, for some integer k between 1 and n, and flip them all.

About

Advance algorithms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /