Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ peek
Function
peek
Stack/stack_implementation_using_array.c:44–51 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
42
return x;
43
}
44
int peek(struct Stack st, int index)
45
{
46
int x = -1;
47
if (st.top - index + 1 < 0)
48
printf(
"Invalid Index \n"
);
49
x = st.S[st.top - index + 1];
50
return x;
51
}
52
int isEmpty(struct Stack st)
53
{
54
if (st.top == -1)
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected