Skip to content

assadsiddiqui/SortApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Read Me

This is a simple code that would involves solving of two different problems based on the methods as shown below. This is a simple problem solving and therefore everything is done in the Program class.

SortArrayWithSmallestInMiddle

Problem: Given an array of list, sort it in such a way that the highest number is at the top, the second highest at the bottom, third highest is at the second position, fourth highest at second last position and so on. This makes the smallest number come in the middle.

Solution: The method SortArrayWithSmallestInMiddle, takes in the array sorts it and only traverses through it once thus making complexity O(n).

FindDuplicate

Problem: Given an array list, find out how many numbers are duplicate and what numbers are those. Performance is the big part of it so it must be efficient.

Solution: The method FindDuplicate uses dictionary (mainly hash) to find the numbers that are duplicate thus going through the array only once.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages