id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

stack_searchStack


Given a Stack of integers and a target value, return true if the value is anywhere in the stack.

YOUR FIRST TWO LINES OF CODE MUST BE:
Stack<Integer> stack = new Stack<Integer>();
stack.addAll(list);

stack_searchStack([1, 2, 3, 4, 5], 3) → true
stack_searchStack([1, 2, 3, 4, 5], 6) → false
stack_searchStack([1, 2, 3, 4, 5], 1) → true

...Save, Compile, Run (ctrl-enter)

public boolean stack_searchStack(List<Integer> list, int value) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy