The Nasdaq composite index surged 178.15, or about 6 percent, to 3,369.55, and the Standard & Poor's 500 index climbed 30.74, or 2 percent, to 1,429.40.
The Dow Jones industrial average closed up 135.37 at 10,971.14, led by IBM, which gained $5.19 to $98.50.
The tech-heavy Nasdaq resurrected itself after a ghoulish performance yesterday when it fell nearly 3 percent, while the Dow has risen nearly 6 percent during the last four sessions. "We have a little bit of a bipolar disorder going on" in the markets, said Jeff Logsdon, a vice president and market analyst at Gerard Klauer Mattison.
Logsdon noted that the markets seemingly operate in two gears: fifth or reverse.
The volatility has also made some investors cautious about venturing back to the market. "The wild swings of the last few months have made people hesitant to buy stocks at a breech" in the markets, said Logsdon.
Among the events propelling tech shares, IBM Japan on Tuesday won a contract worth an estimated $15 billion to provide computer services to Japanese telecom giant NTT.
"The best thing they could do with the money is to buy back their stock, and there's some real value there," said Todd Clark, head of listed trading at WR Hambrecht.
Under the 10-year agreement, Big Blue's Japanese unit will provide the NTT Group with computer services, including the installation and maintenance of IBM hardware, software and services. In turn, NTT Comware, a subsidiary of NTT, will provide IBM with access to its technical employees to work on other IBM projects in Japan.
After sliding yesterday, Cisco Systems rose $5.81, or 12 percent, to $53.88 on a volume of 87.4 million shares, making it the most active stock on the Nasdaq.
Other networking stocks followed Cisco's lead. JDS Uniphase climbed $10.13, or 14 percent, to $81.44; Nortel Networks rose $5.50, or about 14 percent, to $45.50; Ciena gained $14.44, or almost 16 percent, to $105.13; and Sycamore Networks advanced $7.13, or nearly 13 percent, to $63.25.
The CNET tech index climbed 132.62 to 2,698.26. Advancers buried decliners, with 84 of the 96 stocks in the index rising, 10 falling and two remaining unchanged.
Some less-than-favorable economic news failed to scare off investors. The New York-based Conference Board said its Consumer Confidence index fell to 135.2 in October, a steep drop from the revised 142.5 reported in September and the record high of 144.7 registered in May and January.
The decline is a potentially worrisome sign for the approaching holiday retail season.
The Conference Board index, based on a monthly survey of some 5,000 U.S. households, is closely watched because consumer spending makes up about two-thirds of the nation's economic activity. The index compares results with its base year, 1985, when it stood at 100.
Nearly all of the 18 sectors tracked by CNET Investor posted gains. Providers of services to Internet companies blazed the way higher, rising nearly 10 percent, followed by wireless companies, which gained 9 percent. Makers of peripherals for computers were the only losers, falling about 2 percent.
In the Internet services sector, Exodus Communications gained $7.31, or about 28 percent, to $33.56; Ariba climbed $14.19, or 13 percent, to $126.38; and Commerce One rose $7.31, or 13 percent, to $64.19.
Expedia stock surged up $3.75, or 41 percent, to $12.81. Yesterday the online travel company shocked Wall Street with a narrower-than-expected quarterly loss.
The Bellevue, Wash.-based Microsoft spinoff announced Monday that it lost 4 cents per share, excluding charges, in the fiscal first quarter ended Sept. 30. Analysts polled by First Call/Thomson Financial expected Expedia to lose 26 cents per share.
Harmonic rose $4.50, or 45 percent, to $14.50, making it the largest percentage gainer on the Nasdaq. The maker of fiber-optics equipment said AT&T's broadband unit will use Harmonic's optical nodes and transmission platforms in cable upgrades.
Other stocks in the tech sector were not as fortunate. Shares of chip designer Rambus fell $8.50, or nearly 16 percent, to $44.94.
Mountain View, Calif.-based Rambus designs high-speed memory for computers. A little more than a year ago, many believed that memory based around the company's technology would be found in the majority of higher-end desktop computers. But that prospect has been tarnished recently.
The chip sector carried on despite Rambus' woes. The Philadelphia semiconductor index rose 38.80, or about 6 percent, to 741.83 led by Lattice Semiconductor, which gained $3.56, or nearly 14 percent, to $29.19. Advanced Micro Devices also rose $2.38, or nearly 12 percent, to $22.63.