Giter Site home page Giter Site logo

c-practice's Introduction

C-Practice

A few programming answers to C++ interview questions

Hello! In this respository, I am sharing my solutions to a few C++ questions that have been used in coding interviews.

// QUESTIONS

  1. You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. Write a C++ recursive function to determine how many distinct ways you can climb to the top.

  2. Binary Search: Write a C++ function to find the first index of this number in O(log n) time complexity using recursion.

  3. Write a C++ function to recover a rotated array to the original sorted array.

  4. Given an array nums of integers and an int k, partition the array (i.e. move the elements in “nums”) such that: • All elements < k are moved to the left • All elements >= k are moved to the right Return the partitioning index, i.e. the first index i where nums[i] >= k.

  5. Given an unsorted array with integers, find the median of it using the Quick Select method.

c-practice's People

Contributors

vidhurva avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.