Tag Archives: Algorithms

Quick Sort

This quick sort implementation comes from ‘Programming Pearls’ by Jon Bentley. The basic idea of quick sort is ‘divided and conquer’. Choose the pivot Partitioning the array to have half the elements are above the pivot and half the elements … Continue reading

Posted in Algorithms, Technical Interview | Tagged , | Leave a comment

Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct. Difficulty: Easy The … Continue reading

Posted in Algorithms, C | Tagged , , | Leave a comment

Merged two sorted lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists Difficulty: Easy There may be one more ways to solve this problem. … Continue reading

Posted in Algorithms, Technical Interview | Tagged , , | Leave a comment

Merge Sorted Array

Given two sorted integer array A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from … Continue reading

Posted in Algorithms, Technical Interview | Tagged , , | Leave a comment