Image source: The Motley Fool.

Legendary investor Warren Buffett, chairman and CEO of Berkshire Hathaway (BRK.A -0.34%) (BRK.B -0.01%), has led the holding company to outperform the S&P 500 by an average of 11.1% from 1965 through 2015. Just one hundred dollars invested in Berkshire in 1965 would be worth $1.1 million today.

Investors can get in on the Oracle of Omaha's stock-picking prowess by buying shares in Berkshire Hathaway or by buying shares of the public companies in its portfolio. At the end of the second quarter, Berkshire held shares of 44 such companies, with only 20 accounting for more than 0.5% of its total stock portfolio. 

Buffet is beating the broader market so far in 2016, with Berkshire's Class A shares (the super-pricey ones) and B shares (the ones most investors would buy) up 9.4% and 9.2%, respectively, compared with the S&P 500's 6.2% total return. The following eight of Berkshire's largest 20 public holdings have outperformed the broader market so far in 2016.

Rank   Company           Market Cap                     Weight Within Berkshire Portfolio (at end of Q2) Dividend Yield 2016 YTD Total Return                10-Year Total Return
1 The Kraft Heinz Company  $107.8B 22.2% 3.3% 24.3% N/A*
2 Deere & Company  $27.2B 1.4% 2.8% 15.8% 144%
3 IBM  $147.6B 9.5% 3.5% 15.5% 122%
4 Wal-Mart Stores  $211.7B 2.3% 2.9% 14.1% 78.4%
5 Apple  $633.8B 1.1% 1.9% 13.7% 1,100%
6 Verizon Communications  $205B 0.64% 4.5% 13.7% 122%
7 Moody's Corp.  $20.6B 1.8% 1.4% 8% 95.8%
8 Visa  $194.7B 0.58% 0.7% 6.9% N/A**
  Berkshire Hathaway Overall $355.7B / $355.5B  --   9.4% / 9.2%  119% / 119%
   S&P 500     2.07%  6.2% 93.6%

Data sources: SEC filing and YCharts. Market caps and return data to Oct. 14.
* Kraft Heinz began trading on July 6, 2015; it's returned 26.8% since then vs. the S&P 500's 6%.
**Visa began trading in March 2008; it's returned 519% since then vs. the S&P 500's 98%.   

Warren Buffett's best-performing stocks to avoid

First up is Wal-Mart Stores (WMT -1.75%). While the discount retailer's financial performance and stock-price performance have perked up in 2016, there's no reason to believe, in my opinion, that the stock will beat the market again over any significant period. Quite simply, Amazon.com has been eating Wal-Mart's lunch, as folks increasingly embrace not only online shopping, but online shopping at Amazon in particular. 

For the first six months of calendar year 2016 (Wal-Mart's fiscal 2017), the retailer's revenue edged up 0.7% as reported and 3.4% in constant currency from the year-ago period. Meanwhile, its operating income for this period declined 2.6% as reported and 0.1% in constant currency, and adjusted earnings per share declined nearly 3%.  For the full year, analysts expect revenue to increase 1%, but adjusted EPS to fall 5.4%. 

Most buy-and-hold investors should also pass on agricultural equipment titan Deere & Company (DE -0.60%). Its returns listed in the chart conceal the fact that it's an extremely volatile cyclical stock, meaning its fortunes are largely tied to the macroeconomic environment. That's not necessarily a bad thing, but making money in such stocks even over the long haul depends a lot upon the timing of your buys. In fact, Deere's price is still lower than it was at its all-time high about eight years ago. Moreover, the company continues to struggle -- year-over-year revenue and earnings per share dropped 8% and nearly 25%, respectively, in the first half of 2016 -- because agricultural industry fundamentals remain weak.  

Warren Buffett's best-performing stocks worth buying

What stocks are worth buying largely depends upon your primary objective. Verizon, IBM, and Kraft Heinz -- with their 4.5%, 3.5%, and 3.3% dividend yields -- are solid choices for income-seeking investors. Visa is an attractive choice for investors most focused on stock-price appreciation. Its recent acquisition of its Visa Europe unit should help bolster its competitive position against MasterCard, while its recent deal with online-payments giant PayPal provides additional growth potential. Under this deal, PayPal will promote Visa as a payment option and stop encouraging customers to link bank accounts rather than using Visa cards as funding choices. 

The best buy for most investors from a long-term total return basis (stock-price appreciation + dividend yield), however, is Apple (AAPL 0.64%)

Apple

Image source: Apple.

Buffet bought an initial stake in Apple in the first quarter and came back for more shares in the second quarter. He obviously saw value in this humongous long-term winner, with its share price down from its all-time high set in early 2015. 

Apple's stock is down more than 12% from its all-time high, as of Oct. 21. It had been down even more, but it's had a nice run-up in price over the past quarter thanks largely to posting better-than-expected fiscal third-quarter results, the positive buzz surrounding last month's launch of the iPhone 7, and rival Samsung's halting production of its Galaxy Note 7 smartphone earlier this month after several phones overheated and caught on fire.

The core reason behind Apple stock's recent struggles is simple: The company's revenue has been declining because quarterly year-over-year sales of the iPhone have been declining -- and the iconic smartphone accounts for about two-thirds of the company's top line. Falling revenue has hurt profit growth, as is typical.

With Apple's stock trading at a reasonable 13.1 times forward earnings, there are reasons to believe that the market is providing long-term-focused investors with a buying opportunity. Apple is a company with "innovation" programmed into its genes. Granted, co-founder and former CEO Steve Jobs had a huge part in this, but no leader of a company of any significant size is fully responsible for its success. Couple the company's creative chops and cult-like following with its status as a cash-generating machine – it currently has $62.6 billion in cash and equivalents on its balance sheet – and it seems reasonable to assume that the iPhone won't be Apple's last huge winner.

Apple's had modest success with its Apple Watch, but the fast-growing wearables category is still relatively new, so there's surely more growth opportunity here. Moreover, Apple is reportedly working on developing technology for a driverless car, and it wouldn't surprise me if it made a big splash in the nascent virtual-reality market in the near future. There will never be a shortage of new technologies ripe for a company like Apple to wrap in consumer-friendly packages to help drive mass consumer adoption, as it did with the smartphone.