The Gateway to Computer Science Excellence

+2 votes

Any algorithm is in place if it does not need additional auxillary space for data structure and its input is transformed by swapping with some operations.

However a small amount of extra storage space is allowed for auxiliary variables.

Quicksort operates in-place on the data to be sorted. However, quicksort requires O(log *n*) stack space pointers to keep track of the subarrays in its divide and conquer strategy. Consequently, quicksort needs O(log^{2} *n*) additional space. Although this non-constant space technically takes quicksort out of the in-place category, quicksort and other algorithms needing only O(log *n*) additional pointers are usually considered in-place algorithms.

Most selection algorithm are also in-place

u can refer : https://en.wikipedia.org/wiki/In-place_algorithm

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,647 questions

56,492 answers

195,439 comments

100,706 users