LATEST POSTS

CareerCup-5.6

Write a program to swap odd and even bits in an integer with as few instructions as possible.

CareerCup-5.5

Write a function to determine the number of bits required to convert integer A to integer B.

CareerCup-5.3

Given an integer, print the next smallest and next largest number that have the same number of 1 bits in their binary representation.

bat实现IP切换

出差调试设备,需要在几个网段之间切换,因此做了个bat实现快速切换。

CareerCup-5.2

Given a number that is passed in as a string, print the binary representation.

CareerCup-5.1

You are given two 32-bit numbers, N and M, and two bit positions, i and j. Write a method to set all bits between i and j in N equal to M.

CareerCup-4.6

Design an algorithm and write code to find the first common ancestor of two nodes in a binary tree Avoid storing additional nodes in a data structure.

CareerCup-4.5

Write an algorithm to find the ‘next’ node of a given node in a binary search tree where each node has a link to its parent.

CareerCup-4.4

Given a binary search tree, design an algorithm which creates a linked list of all the nodes at each depth.

CareerCup-4.3

Given a sorted array, write an algorithm to create a binary tree with minimal height.

CareerCup-4.2

Given a directed graph, design an algorithm to find out whether there is a route between two nodes.